[openstreetmap/openstreetmap-website] Separate translations for "zero" and "zero like numbers" (Issue #3997)
Philippe Verdy
notifications at github.com
Tue Apr 4 02:22:16 UTC 2023
Note also that in the example above, even in English this is not correct. With CLDR-named classifiers like "zero=", the value does not mean that it is exactly "0", it means that it is a value having the same grammatical plural form as zero, so it shuold not be used at all for translating "No reports".
The generic CLDR-like plural classifiers are completely ignored in any language that don't have such plural classifier. English is such an example, as it only defines "one" (for the English singular) and "other" (for the default English plural), but does not define "zero", "two", "few", and "many" (so using "zero" in English is also incorrect).
But in languages that define a generic CLDR classifier, multiple actual values of the variable "%{count}" could map to that classifier, the value MUST be present in the returned text. In addition, if there's a classifier for the targetr language but it is missing in the message, the language defines which other classifer will act as a fallback (the "other" classifier for the last fallback should be present in the message, otherwise the value should be empty).
For translating "No reports", this can only be mapped as an numeric override "0=No reports" (not using any generic CLDR classifier), that takes precedence to any possible CLDR classifiers when the actual value of the parameter is exactly "0". But not "0.0" which is matched in English by its plural in the "other" classifier! (And also not "10" for a language that would map "10" in the generic "zero" class defined for that language)
The same applies to Polish, which also incorrectly uses "one=1 zgloswenie", instead of "one=%{count} zgloswenie" (using a genric classifier) or "1=1 zgloswenie" (using a numeric override).
In the MediaWiki "{{PLURAL:$variable|...}}" syntax (currently not used by OSM's i18n framework), the CLDR "other" classifier (defined in CLDR for ALL languages, including those that don't have variable forms for the grammatical plural) must not be specified explicitly as "|other=...", it must be the last option "|...}}".
The source message above using the OSM i18N framework in the English source also sets "|%{count} reports}}" without naming the generic "other=" classifier, so this should also be the case in Polish (the error reported by TWN is then correct). However for compatiblity it could be acceptable to name the "other=" classifier explicitly, without having to set a last value without assigning to any generic classifier or numeric override (but using simultaneously "|other=..." and "|...}}" would be ambiguous and should be invalid).
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/issues/3997#issuecomment-1495247936
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/issues/3997/1495247936 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230403/26a2ff59/attachment-0001.htm>
More information about the rails-dev
mailing list