Description
Describe the bug
The i18n package is missing the CLD rule parser, so plurals don't work for many languages.
To Reproduce
Per #1858 (comment)
$.i18n().locale = 'en';
$.i18n("$1 de $2 {{plural:$2|page|pages}}", 5, 10);
$.i18n().locale = 'fr';
$.i18n("$1 de $2 {{plural:$2|page|pages}}", 5, 10);
The last line gives this:
project-bundle.js:28751 Uncaught ReferenceError: pluralRuleParser is not defined
at Object.getPluralForm (project-bundle.js:28751)
at Object.convertPlural (project-bundle.js:28751)
at Object.plural (project-bundle.js:28744)
at Object.emit (project-bundle.js:28744)
at project-bundle.js:28744
at Function.map (project-bundle.js:504)
at Object.emit (project-bundle.js:28744)
at Object.parse (project-bundle.js:28739)
at a.parse (project-bundle.js:28723)
at Function.e.i18n (project-bundle.js:28723)
Proposed solution
Include https://github.com/santhoshtr/CLDRPluralRuleParser/blob/8baf9aedc428924fe6ee508b3d952cb5564efb3a/src/CLDRPluralRuleParser.js
(and perhaps https://github.com/santhoshtr/CLDRPluralRuleParser/blob/8baf9aedc428924fe6ee508b3d952cb5564efb3a/data/plurals.json)
(check for the appropriate version to match the version of Wikimedia i18n that we're using)
OpenRefine:
- Version 3.4 beta - current master