Article
zero - a string for zero, the absence of something; in some languages, also for numbers ending in zero; one is a string for numbers ending in one; in some languages, only for a unit;
two - for numbers ending in two, or only for two;
few — here, under the word “several,” the specifics are no longer hidden, the processing is completely dependent on the language rules; for example, for the Russian language, this refers to numbers ending in 2, 3, and 4 (this is the case, despite the existence of the “two” rule);
many - similarly, a “non-specific” category, it can be understood as “something more than a few”; in Russian - from the top five and above;
other - everything else.
In short, the unique rules are formulated for each language separately.
At the end of the article there is an example that should dispel all misunderstandings:
<plurals name="plurals_2"> <item quantity="zero">нет андроидов</item> <item quantity="one">%1$d андроид</item> <item quantity="two">%1$d андроида</item> <item quantity="few">%1$d андроида</item> <item quantity="many">%1$d андроидов</item> <item quantity="other">%1$d андроидов</item> </plurals> // Выведем данные в формате: 8 = many : 8 андроидов for (int i = 0; i < 30; i++) { String pluralTest = this.getResources().getQuantityString(R.plurals.plurals_1, i, i); String pluralAndroid = this.getResources().getQuantityString(R.plurals.plurals_2, i, i); android.util.Log.i("Plurals", pluralTest + " : " + pluralAndroid); }
Result:
0 = many : 0 андроидов 1 = one : 1 андроид 2 = few : 2 андроида 3 = few : 3 андроида 4 = few : 4 андроида 5 = many : 5 андроидов 6 = many : 6 андроидов 7 = many : 7 андроидов 8 = many : 8 андроидов 9 = many : 9 андроидов 10 = many : 10 андроидов 11 = many : 11 андроидов 12 = many : 12 андроидов 13 = many : 13 андроидов 14 = many : 14 андроидов 15 = many : 15 андроидов 16 = many : 16 андроидов 17 = many : 17 андроидов 18 = many : 18 андроидов 19 = many : 19 андроидов 20 = many : 20 андроидов 21 = one : 21 андроид 22 = few : 22 андроида 23 = few : 23 андроида 24 = few : 24 андроида 25 = many : 25 андроидов 26 = many : 26 андроидов 27 = many : 27 андроидов 28 = many : 28 андроидов 29 = many : 29 андроидов
Total for the Russian language:
Zero is used for zero.
For numbers ending in 1 (except numbers ending in 11 ), one is used.
For numbers ending in 2 (except numbers ending in 12 ) two is used (only in Russian, few are used for these numbers)
For numbers ending in 3, 4 (except numbers ending in 13 , 14 ) few are used.
For all others, many are used.
Other is used for other cases that are not in Russian.
Despite this, one and the other are a mandatory minimum that should always be defined.
The same article describes a problem with plurals on API <3.0. There all plurals work according to the rules of the English language. The solution to this problem is also described there - use the android-i18n-plurals library,
P. S. I took all of the above from the above article, and if
mastered it for this article. The question remained unclosed
then this means only one thing - poorly mastered.