Incorrect number of plural forms now reported on the l10n dashboard

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Incorrect number of plural forms now reported on the l10n dashboard

Francesco Lodolo [:flod]
Hi,
Starting from yesterday, compare-locales and the l10n dashboard are
reporting incorrect number of plural forms as warnings.
https://l10n.mozilla.org/

For example
https://l10n.mozilla.org/dashboard/compare?run=898125#issue1

*How plurals work in .properties files*
Plural forms in Firefox and Firefox for Android are obtained using a
hack on top of .properties files (plural forms are separated by a
semicolon). For example:

 > #1 tab has arrived from #2;#1 tabs have arrived from #2

English has 2 plural forms, one for singular, and one for all other
numbers. The situation is much more complex for other languages,
reaching up to 5 or 6 plural forms.

In Russian the same string has 3 forms, each one separated from the
other by a semicolon:

 > С #2 получена #1 вкладка;С #2 получено #1 вкладки;С #2 получено #1
вкладок

The semicolon is a separator, not a standard punctuation element:
* You should consider each sentence separately (I've seen locales
starting the second sentence lowercase because of the semicolon).
* You shouldn't replace the semicolon with a character from your script,
or another punctuation sign (comma, period).

*Edge cases*
Sometimes English only has one form, because the string is used for
cases where the number is larger than 1.

 > ;Close #1 tabs

Note that this string has still two plural forms, the first form (used
for case '1', or singular in English) it's empty. That's why the string
starts with a semicolon. If your locale only has 1 form, you should drop
the leading semicolon.

In other cases, the variable is indicated only in the second form:

 > Close one tab;Close #1 tabs

If your locale only has 1 form, or doesn't differentiate the case for
'1', use the second sentence as reference.

There are also cases of "poor" plural forms, where the plural is
actually used as a replacement for "1 vs many". These are bugs, and
should be fixed

For example:
https://transvision.mozfr.org/?recherche=browser%2Fchrome%2Fbrowser%2Fbrowser.properties%3AaddonsGenericInstalledNeedsRestart&repo=gecko_strings&sourcelocale=en-US&locale=en-US&search_type=entities&entire_string=entire_string

This string was fixed in Firefox 59 (bug 658191).

*Known limitations*
Gecko supports plurals only in .properties files, not in DTD, and
JavaScript code (not C++).

Francesco

[1] https://blog.mozilla.org/l10n/2017/12/08/l10n-report-december-edition/
_______________________________________________
dev-l10n mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-l10n
Reply | Threaded
Open this post in threaded view
|

Re: Incorrect number of plural forms now reported on the l10n dashboard

Francesco Lodolo [:flod]
One more note: DevTools.

If your locale has more plural forms than English, and you're copying
and pasting English into DevTools strings, you'll get warnings.

Feel free to ignore them, as there's no way to exclude locales at this
point. To fix them, you can either unapprove these strings in Pontoon,
or create the correct number of plural forms by copying the English text
as needed.

Francesco

> Hi,
> Starting from yesterday, compare-locales and the l10n dashboard are
> reporting incorrect number of plural forms as warnings.
> https://l10n.mozilla.org/
>
> For example
> https://l10n.mozilla.org/dashboard/compare?run=898125#issue1
>
> *How plurals work in .properties files*
> Plural forms in Firefox and Firefox for Android are obtained using a
> hack on top of .properties files (plural forms are separated by a
> semicolon). For example:
>
> > #1 tab has arrived from #2;#1 tabs have arrived from #2
>
> English has 2 plural forms, one for singular, and one for all other
> numbers. The situation is much more complex for other languages,
> reaching up to 5 or 6 plural forms.
>
> In Russian the same string has 3 forms, each one separated from the
> other by a semicolon:
>
> > С #2 получена #1 вкладка;С #2 получено #1 вкладки;С #2 получено #1
> вкладок
>
> The semicolon is a separator, not a standard punctuation element:
> * You should consider each sentence separately (I've seen locales
> starting the second sentence lowercase because of the semicolon).
> * You shouldn't replace the semicolon with a character from your
> script, or another punctuation sign (comma, period).
>
> *Edge cases*
> Sometimes English only has one form, because the string is used for
> cases where the number is larger than 1.
>
> > ;Close #1 tabs
>
> Note that this string has still two plural forms, the first form (used
> for case '1', or singular in English) it's empty. That's why the
> string starts with a semicolon. If your locale only has 1 form, you
> should drop the leading semicolon.
>
> In other cases, the variable is indicated only in the second form:
>
> > Close one tab;Close #1 tabs
>
> If your locale only has 1 form, or doesn't differentiate the case for
> '1', use the second sentence as reference.
>
> There are also cases of "poor" plural forms, where the plural is
> actually used as a replacement for "1 vs many". These are bugs, and
> should be fixed
>
> For example:
> https://transvision.mozfr.org/?recherche=browser%2Fchrome%2Fbrowser%2Fbrowser.properties%3AaddonsGenericInstalledNeedsRestart&repo=gecko_strings&sourcelocale=en-US&locale=en-US&search_type=entities&entire_string=entire_string
>
> This string was fixed in Firefox 59 (bug 658191).
>
> *Known limitations*
> Gecko supports plurals only in .properties files, not in DTD, and
> JavaScript code (not C++).
>
> Francesco
>
> [1] https://blog.mozilla.org/l10n/2017/12/08/l10n-report-december-edition/

_______________________________________________
dev-l10n mailing list
[hidden email]
https://lists.mozilla.org/listinfo/dev-l10n