I18n_lint.rb pluralization keys can't be `zero`

Why can’t I have a zero serialization in client.en.yml?

https://github.com/literatecomputing/discourse-max-topics-per-month/blob/main/config/locales/client.en.yml#L5

https://github.com/discourse/discourse/blob/master/script/i18n_lint.rb#L38

https://github.com/discourse/discourse/blob/master/script/i18n_lint.rb#L33

Is there a reason not to use PLURALIZATION_KEYS rather than ENGLISH_KEYS here?

https://github.com/discourse/discourse/blob/master/script/i18n_lint.rb#L125

The zero appears to work fine in my code (which is broken for at least one other reason not caught by my tests).

It works because the i18n code has a special case for the zero key. You can continue using it as long as you don’t intend to use a translation platform like Transifex or Crowdin. Unless something changed, they support only keys defined by Unicode which are “one” and “other” for English. So, translating the “zero” key won’t work because those platforms ignore it when they parse English locale files.

Darn. I’m afraid that makes sense. :sob:

Thanks for the explanation.

1 Like