Problem/Motivation
When exporting translations through the user interface at /admin/config/regional/translate/export, the resulting file contains a hardcoded plural form in the header:
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
The number of plurals and the associated plural formula is different per language. As a result, any Drupal site that imports the resulting .po file will display incorrect translations for plural strings.
Proposed resolution
Update the PoHeader with the correct nplurals and plural formula based on PluralFormulaInterface::getNumberOfPlurals() and PluralFormulaInterface::getFormula()
Since PluralFormulaInterface::getFormula() currently does not return a formula, this is postponed on #2882617: PluralFormula should return the plural formula in string format
Remaining tasks
- Write a patch
- Review
- Commit
User interface changes
Drupal sites that have imported a .po file with the incorrect plural formula will display the correct plural strings after it imports a correct .po file
API changes
To be determined.
Data model changes
To be determined.