wikimedia / banana-i18n

banana-i18n - Javascript Internationalization library
https://wikimedia.github.io/banana-i18n/
MIT License
80 stars 27 forks source link

gender: when gender not passed, avoid error, fallback to neutral #57

Closed santhoshtr closed 3 years ago

santhoshtr commented 3 years ago

Messages like {{GENDER:|A|B|C}} were causing parser failures. This patch fixes the parser and introduce a fallback to neutral form.

As a mediawiki independent library, while Gender is supported, we cannot support gender with current logged in user. For that explicit gender param placeholder needed(example: {{GENDER:$1|A|B|C}}

santhoshtr commented 3 years ago

I found this issue while testing https://phabricator.wikimedia.org/T271918. A few messages from hebrew has Gender without gender information. Example {{GENDER:|הרחב|הרחיבי}} באמצעות הוספת {{PLURAL:$2|$1 ועוד פרק|$1 ועוד $2 פרקים|0=$1}}"