Page MenuHomePhabricator

Plural translations in GettextFFS for languages with no separate plural forms are broken when exported
Closed, ResolvedPublic

Description

In TWN, a message is translated as {{PLURAL:GETTEXT|已上傳 1 個文件。|已上傳 %(counter)s 個文件。}} into zh-hant. However, when I look into Tracker's sourcecode, I see this:

#: tracker/templates/admin/tracker/ticket/change_form.html:46
#: tracker/templates/tracker/ticket_detail.html:64
#, python-format
msgid "There is 1 document uploaded."
msgid_plural "There are %(counter)s documents uploaded."
msgstr[0] "已上傳 1 個文件。"

There's nothing about the plural part. IMO, there should be msgstr[1] "已上傳 %(counter)s 個文件。" as well. What's the cause?

Something similar happened with Turkish as well, see sourcecode.

Event Timeline

Chinese language does not use plural per https://gerrit.wikimedia.org/g/mediawiki/extensions/Translate/+/8341a7264898914ab33d3443a79fdbbdce6a27d2/data/plural-gettext.txt#128

Look like our Gettext plural validator is too lenient and does not even warn when too many plural forms are provided for nplurals=1 languages.

Nikerabbit renamed this task from Messages aren't exported in full to Plural translations in GettextFFS for languages with no separate plural forms are broken when exported.Dec 10 2019, 8:47 AM
Nikerabbit claimed this task.

Currently if I try to edit the message, the translation validators fail with an error saying that there is incorrect number of plural forms.