不同的国家有不同的十进制分离器和上千台分离器:
.),一千(,),),一千(.)在编写文本时,是否有一种方式对数字进行注释,以使翻译引擎有一个更轻松的时间?
有点像
(1) Germany has a population of <number>83000000</number>.
(2) <number>57.3</number>% of them are Christian.
(3) Both are in <number>12345678.9</number>.对于英语用户,数字应呈现如下内容:
(1) Germany has a population of 83,000,000.
(2) 57.3% of them are Christian.
(3) Both are in 12,345,678.9翻译引擎可以轻松地将数字转换为:
(1) Germany has a population of 83.000.000.
(2) 57,3% of them are Christian.
(3) Both are in 12.345.678,9谷歌翻译在没有注释的情况下获得了(1)和(2)正确的结果,但没有(3)。
(注:这是我问题是否有一种标准化的方法来注释数量以允许HTML中的自动本地化?的一个更基本的变体)
发布于 2019-05-08 05:36:07
你可以试试这个方法:
// For English Users
$(function(){
$("#ban").text((1234567.89).toLocaleString('en'))
})
/*
// For German Users
$(function(){
$("#ban").text((1234567.89).toLocaleString('de'))
})
*/<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<div id="ban">
</div>
https://stackoverflow.com/questions/56034013
复制相似问题