Getting an error / warning for the plural: "The number" one "corresponds to more than one particular number ..."

Background

I am working on an application in which there are many translations inside.

I have the following english multiple lines:

<plurals name="something"> <item quantity="one">added photo</item> <item quantity="other">added %d photos</item> </plurals> 

and French translation:

 <plurals name="something"> <item quantity="one">a ajouté une photo</item> <item quantity="other">a ajouté %d photos</item> </plurals> 

Problem

For French and Russian, I get the following warning:

The number "one" matches more than one particular number in this locale, but the message does not contain a formatting argument (for example,% D). This is usually a mistake of internationalization. See the full release explanation for more.

when you select the details, it says: enter image description here

Thins is, I do not understand what needs to be done to fix this, and if there is even a problem ...

Question

What exactly should I do with these lines? What should I say to translators?

+7
android string plural language-translation
source share
2 answers

In the French singular form it is used when count is 0 or 1. In the English single form it is used only when the count is 1. 0 uses the plural form.

That's why you need to insert a placeholder (% d) in your French custom template.

0
source share

I am going to write an answer because this is a rather complicated explanation.

Different nouns use a single form if they end with 1. Contact: http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html

Explaining in English, there are languages ​​where it is correct to say "1 photo added", as well as "101 photos added." Pay attention to the "photo". Thus, this means that you should always add "% d" on one line. Android will choose the best scenario to use. This means that in English, he will choose “other” for numbers> 1, and in other languages ​​he will choose “one” for numbers ending in one.

Resume, add to% d on your one line and should be fine. Also make sure your translators respect the plurality rules for their language.

+3
source share

All Articles