Re:Fluent 1.0: a localization system for natural-sounding tr...
by aembleton on Wednesday April 17, 2019 @01:28PM
(#19684561)
This confused me too. To take the example, I'd prefer the following:
Specify a range (2..4). The second option shouldn't need to match as it is the default value anyway (signified by the *)
[ Parent
| on HN ]
Re:Fluent 1.0: a localization system for natural-sounding tr...
by stasm on Thursday April 18, 2019 @01:51PM
(#19693127)
The (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/langu...
[1] http://unicode.org/reports/tr35/tr35-numbers.html#Operands
Re:Fluent 1.0: a localization system for natural-sounding tr...
by stasm on Thursday April 18, 2019 @01:55PM
(#19693171)
> 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.