messageformat / Jed

Gettext Style i18n for Modern JavaScript Apps
http://messageformat.github.io/Jed
MIT License
873 stars 68 forks source link

Confusing plural examples #58

Open timwhitlock opened 6 years ago

timwhitlock commented 6 years ago

There are two examples of plural forms on this page

  1. "%d key" : [ "%d key", "%d keys" ],
  2. "test singular": ["test plural", "test_1 singular", "test_1 plural"],

These appear to be different structures. Using Gettext terminology they look like:

  1. msgid: [ msgstr1, msgstr2 ]
  2. msgid: [ msgid_plural, msgstr1, msgstr2 ]

Can you please clarify how this structure should be used and whether it has changed at some point?

kbrock commented 2 years ago

Different languages have different pluralization rules.

English only has 2 forms: singular (used for 1) and plural (used for 0 or more than 1)

Arabic has 6. see http://docs.translatehouse.org/projects/localization-guide/en/latest/l10n/pluralforms.html