According to the l20n documentation example, the library can support "complex language plurals".
In the Firefox download panel, a string like this shows up while downloading file:
4 hours, 1 minute and 26 seconds remaining
.
Unfortunately, the given example seems not work with the 3.0.4
release.
HTML markup:
<span data-l10n-id="minutesAgo" data-l10n-args="{'minutes':52}"></span>
Language file (en-US.l20n
):
# Date time
<pluralDateTime($n) {
$n == 0 ? "zero" :
$n % 100 == 1 ? "one" :
$n % 100 == 2 ? "two" :
$n % 100 == 3 || $n % 100 == 4 ? "few" :
"many"
}>
<_minutes {
one: "minute",
two: "minutes",
few: "minutes",
many: "minutes"
}>
<minutesAgo "{{ $minutes }} {{ _minutes[pluralDateTime($minutes)] }} ago">
Current Result:
52 undefined ago
Expected result:
52 minutes ago
What is the current syntax for plurals?