Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 294800

[PP-1] Interface translations export contains incorrect plural formula

$
0
0

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

  1. Write a patch
  2. Review
  3. 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.


Viewing all articles
Browse latest Browse all 294800

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>