lingui / js-lingui

🌍 📖 A readable, automated, and optimized (3 kb) internationalization for JavaScript
https://lingui.dev
MIT License
4.49k stars 378 forks source link

Add support for range pluralization rules #16

Closed tricoder42 closed 6 years ago

tricoder42 commented 7 years ago

Interesting feature. Plurals have next to ordinal and cardinal also third category: range: http://www.unicode.org/cldr/charts/28/supplemental/language_plural_rules.html

From: https://github.com/yahoo/react-intl/issues/868

tricoder42 commented 7 years ago

Question is, how to extend ICU MessageFormat with ranges. MessageFormat allows formatting of single variables in form {argument, formatType, formatArguments}. However, range depends on two arguments.

Two possible variants:

  1. {argument1 argument2, range} - Probably breaks a lot of MessageFormat parsers
  2. {argument1, range, argument2} - Valid ICU and also it can be read as argument1-argument2
tricoder42 commented 6 years ago

Let's do it later™️