3 ms·
This confused me too. To take the example, I'd prefer the following: tabs-close-warning-multiple = {$count -> [2..4] Chystáte se zavřít {$count} panel
by aembleton 8y ago
This confused me too. To take the example, I'd prefer the following:
tabs-close-warning-multiple = {$count ->
[2..4] Chystáte se zavřít {$count} panely. Opravdu chcete pokračovat?
*[] Chystáte se zavřít {$count} panelů. Opravdu chcete pokračovat?
}
Specify a range (2..4). The second option shouldn't need to match as it is the default value anyway (signified by the *)
- stasm 8y agoThe (2..4) range would work for Czech in this example (if I'm reading the CLDR right), but I'm afraid it wouldn't be sufficient for languages with more complex plural rules. Take the rule that returns "one" in Latvian, for example: n % 10 = 1 and n % 100 != 11 or v = 2 and f % 10 = 1 and f % 100 != 11 or v != 2 and f % 10 = 1 …where n is the absolute value of the number, f is the visible fractional digits with trailing zeros, and v is _the number_ of visible fraction digits with trailing zeros. Some rules can get even more complex than that; see [0] and [1]. It's safer and more robust to rely on the plural categories defined by the Unicode: (zero | one | two | few | many | other), and by the APIs provided by the platform (ICU, Intl.PluralRules, etc.). [0] http://www.unicode.org/cldr/charts/latest/supplemental/language_plural_rules.html http://www.unicode.org/cldr/charts/latest/supplemental/langu... [1] http://unicode.org/reports/tr35/tr35-numbers.html#Operands http://unicode.org/reports/tr35/tr35-numbers.html#Operands
- stasm 8y ago> The second option shouldn't need to match as it is the default value anyway (signified by the *) That's an interesting suggestion! Right now, the identifier between the brackets is required, but we could relax this in the future. In 1.0, we erred on the side of more conservative and explicit design, to improve the readability and discoverability of the syntax for translators.