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?
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.
Yes, the usage of two is specific to locale. Just because you give it the number 2 does not mean that it will use quantity="two". It will only use that quantity for languages that have special cases for the number 2
From http://developer.android.com/guide/topics/resources/string-resource.html#Plurals:
Note that the selection is made based on grammatical necessity. A string for zero in English will be ignored even if the quantity is 0, because 0 isn't grammatically different from 2, or any other number except 1 ("zero books", "one book", "two books", and so on). Don't be misled either by the fact that, say, two sounds like it could only apply to the quantity 2: a language may require that 2, 12, 102 (and so on) are all treated like one another but differently to other quantities. Rely on your translator to know what distinctions their language actually insists upon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With