Formatting plural on Shapado and Open Street Map
I am having difficulty understanding how to translate plural formatting in messages on Shapado (example) and Open Steet Map (example). Both these use CLDR plural formatting. Having studied the translations I think I understand how to proceed. In general, you would write for any message - {{PLURAL|zero=text|one=text|two=text|few=text|many=text|text}}. 'text' in the example may contain the variable %{count}, which is rendered as a number in digits. The last item listed covers 'other'. The forms available for a particular language are listed on CLDR. You only need to write the forms needed for that message. You can add zero= to the message, even if, like English, zero is not included in the forms for your language on CLDR. Is this right? If so, I will try to write this up on FAQ and also on the plural page.
What happens if you don't need some of the forms available in your language for a particular message? Can you just write {{PLURAL|one=text|text}} if you only need the two forms in that particular message? Or just '{{PLURAL|text}}' or 'text' if you don't need plural at all for that message?
You should always use all n forms if your language has n forms. No more, no less. The potential duplication involved in some cases is "system cost". I know this works differently in MediaWiki, but not all products have as advanced an internationalisation framework as MediaWiki has.
I have found some documentation on using plural on CLDR. There it says that "There are two extra values that can be used with count attributes: 0 and 1. These are used for the explicit values, and may or may not be the same as the forms for "zero" and "one"." That appears to be potentially very useful. So in Bosnian Bs for example, could you have {{PLURAL|0=text|1=text|one=text|few=text|many=text|text}}? The category 'one' in Bosnian includes 1, 21, 31, 41, 51, 61... If so, then the problem outlined in this thread appears to me to go away.
In English messages I note that the examples above include the category 'zero' even though English doesn't have a category 'zero'. Shouldn't the messages have '0' instead of 'zero'?
> Shouldn't the messages have '0' instead of 'zero'?
No.
> You should always use all n forms if your language has n forms. No more, no less.
If an English message uses 'zero' do all languages have to use 'zero', regardless of whether 'zero' is defined for their language or not?
All languages support a key of 'zero' which is handled outside of the language specific pluralizers as seen here:
https://github.com/svenfuchs/i18n/blob/master/lib/i18n/backend/pluralization.rb#L34
So if the value is 0 and a key of "zero" exists then it is used, otherwise the language specific pluralizer is called.