数量和QUOT;二"不工作在Android的字符串,资源多元 [英] Quantity "two" not working in Android Strings-Resources Plural

查看:159
本文介绍了数量和QUOT;二"不工作在Android的字符串,资源多元的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android的允许翻译定义复数。下面的例子对我的作品与语言环境EN:

Android allows translators to define Plurals. The following example works for me with locale 'en':

<plurals name="numberOfSongsAvailable">
    <item quantity="one">One song found.</item>
    <item quantity="other">%d songs found.</item>
</plurals>

但增加了对两个不工作,依然是版本采取了特殊的价值。是的使用两个依赖于语言环境时?因此,没有安卓只能坐两个版本如果区域明确规定,应该有一个两个的版本?

But adding a special value for two does not work, still the other version is taken. Is the usage of two dependent upon the locale? So does Android only take the two version if the locale explicitly specifies that there should be a two version?

所谓问题的Andr​​oid复数处理零插播同样的错误时,使用英语这也​​是不支持的。还有,除了这个问题没有解决方案,以避免,我想避免的Andr​​oid复数。

The SO Question Android plurals treatment of "zero" spots the same mistake when using zero in English which is also not supported. There are no solutions in this question except to avoid Android plurals which I want to avoid.

推荐答案

Android正在使用CLDR复数系统,而这仅仅是不是它是如何工作(所以不要指望这种改变)。

Android is using the CLDR plurals system, and this is just not how it works (so don't expect this to change).

该系统的描述如下:

<一个href="http://cldr.uni$c$c.org/index/cldr-spec/plural-rules">http://cldr.uni$c$c.org/index/cldr-spec/plural-rules

在简而言之,要明白,一并不意味着属于每个类别由CLDR数据库规则被定义数字1相反,这些关键字是类别,具体个数n是很重要的:

In short, it's important to understand that "one" does not mean the number 1. Instead these keywords are categories, and the specific numbers n that belong to each category are defined by rules in the CLDR database:

<一个href="http://uni$c$c.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html">http://uni$c$c.org/repos/cldr-tmp/trunk/diff/supplemental/language_plural_rules.html

尽管似乎没有语言,使用零任何东西0以外,还有其分配0一的语言。当然,还有很多案例,其中两节包含其他的数字比只有2。

While there appears to be no language which uses "zero" for anything other than 0, there are languages which assign 0 to "one". There are certainly plenty of cases where "two" contains other numbers than just 2.

如果机器人在那里,让你做你意,你的应用程序不能正确地翻译成任何数量的更复杂的复数规则语言。

If Android where to allow you to do what you intended, your applications could not be properly translated into any number of languages with more complex plural rules.

这篇关于数量和QUOT;二&QUOT;不工作在Android的字符串,资源多元的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆