Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
3.3-rc-1
-
None
-
Medium
-
Description
Doing a translation of this message to Ukrainian
{0,choice,0#No|1#One|1<{0}} included {0,choice,0#documents.|1#document:|1}
I found that it's not possible to build proper translation due to limitations of standard ChoiceFormat.
The issue is related to
- the fact that nouns have different endings, depending on the last digit of the numeric
- an exception to the generic rule in case of 0, 11, 12, 13 and 14
Another formatter should be added, extending the Choice one, with support for the following more complex rules.
Assume given numeric X, following rules about the endings apply (in the listed order)
Order # | Case | Ending |
---|---|---|
1 | X=0 | 'документ-а' |
For X>0: | ||
2 | X%100 in {11,12,13,14} | 'документ-ів' |
3 | X%10 = 1 | 'документ-' |
4 | X%10 in {2,3,4} | 'документ-и' |
5 | X%10 in {5,6,7,8,9,0} | 'документ-ів' |
Similar (but not exact) rules apply to Russian.