本地化和十进制数字列表
我正在对应用程序中的一些字符串进行本地化,我们的文本看起来像:
Factor f (1.0, 1.2, or 1.5)
在使用逗号作为小数点的语言环境中,这会写成:
Factor f (1,0, 1,2, or 1,5)
也许这不是我习惯的方式,但是看起来很难快速阅读。
我还想知道版本号等文本。 Firefox 3.5.1 会是 Firefox 3,5,1 吗?
I'm working on localizing some strings in our application and we have text that looks something like:
Factor f (1.0, 1.2, or 1.5)
In a locale that uses a comma for the decimal point, would this be written as:
Factor f (1,0, 1,2, or 1,5)
Maybe it's just not what I'm accustomed to, but that looks crazy hard to read quickly.
I'm also wondering about text like version numbers. Would Firefox 3.5.1 be Firefox 3,5,1?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
如果我明白你在寻找什么,这里有两件事与国际化有关:
显然这些分隔符是紧密耦合的,因此在使用逗号作为小数分隔符的语言环境中,列表分隔符必须是其他东西。通常这是一个分号,只有少数区域设置使用与逗号或分号不同的内容作为列表分隔符。
总结一下:
在使用 点 作为小数点分隔符的语言环境中,逗号 通常用作列表分隔符,因此在某些自由格式文本中,您可能会期望类似
因子 f(1.0、1.2 或 1.5)
。在使用逗号作为小数分隔符的语言环境中,分号通常用作列表分隔符 -
Faktor f (1,0; 1,2; oder 1, 5)
是你应该期待的。我不确定你在做什么(技术在建议中确实很重要),但你可以将格式和列表分隔符留给翻译人员来决定。不过,在 .Net 中给出了列表分隔符(无需要求翻译人员输入,只需使用
CultureInfo
类的适当属性即可)。If I understand what you are looking for, there are two things in regards to Internationalization here:
Obviously these separators are quite tightly coupled, so in Locale that uses comma as decimal separator, list separator must be something else. Usually this is a semicolon and there just a few Locales that uses something different than comma or semicolon for list separator.
To summarize:
In Locales that uses dot as a decimal separator, comma is usually used as a list separator, so in some free-form text you might expect something like
Factor f (1.0, 1.2, or 1.5)
.In Locales that uses comma as a decimal separator, semicolon is typically used as a list separator –
Faktor f (1,0; 1,2; oder 1,5)
is something you should expect.I am not sure what you are up to (the technology does matter in the advice) but you can leave the format as well as list separator to the translators to decide. In .Net list separator is given, though (no need to ask translators for input, just use appropriate property of
CultureInfo
class).抱歉,我不知道你的第一个问题。然而,就版本号而言,它们通常未翻译。最终用户通常对版本的数字值没有什么意义(它们实际上不是数字。
3.90
<3.100
)。它们只是带有普遍接受的分隔符的离散数字,而不是带有自然“分组/小数”分隔符的自然数。除了最终用户对版本号的体验之外。开发人员通常以
{major}.{minor}.{revision}
标准格式解析版本号,并使用.
作为众所周知的分隔符。我确实找到了 此链接 讨论了您的第一个问题(有点)。我不知道它的权威性和可信度如何;但这看起来并不可疑。
Sorry to say, but I don't know about your first question. However, as far as version numbers go, they are generally left untranslated. End users typically attribute little meaning to the version's numeric value (they are infact NOT numeric in nature.
3.90
<3.100
). They are simply discrete numbers with a universally-accepted separator, and not natural numbers with natural "grouping/decimal" separators.In addition to end-user experience with version numbers. Developers are often known to parse version numbers in the standard format of
{major}.{minor}.{revision}
, using.
as the well-known seperator character.I did find this link that talks about your first question (sort of). I don't know how authoritative or credible it is; but it doesn't look dubious.