Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#10533 closed (fixed)

Invalid format specifiers for singular and plural forms

Reported by: Jarek Zgoda Owned by: nobody
Component: Translations Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


I seem to be unable to compile translation catalog for Polish language, I cann't find any reasonable cause. The problem is signaled by msgfmt as wrong format specifier. The problematic section is:

#: contrib/admin/
#, python-format
msgid "%(count)s %(singular)s was changed successfully."
msgid_plural "%(count)s %(plural)s were changed successfully."
msgstr[0] "%(count)s %(singular)s został zmieniony."
msgstr[1] "%(count)s %(plural)s zostały zmienione."
msgstr[2] "%(count)s %(plural)s zostało zmienionych."

The problematic line is msgstr[0]. My msgfmt seems to not accept %(singular)s as valid format specifier:

jarek:~/install/django/django$ LANG=C compilemessages -l pl
processing file django.po in /Users/jarek/install/django/django/conf/locale/pl/LC_MESSAGES
/Users/jarek/install/django/django/conf/locale/pl/LC_MESSAGES/django.po:378: a format specification for argument 'singular', as in 'msgstr[0]', doesn't exist in 'msgid'
msgfmt: found 1 fatal error

If I change the specifier to %(plural)s the compilation succeeds, but in a result plural form is used instead of singular.

Change History (2)

comment:1 Changed 8 years ago by Malcolm Tredinnick

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset
Resolution: fixed
Status: newclosed

Fixed in r10081.

comment:2 Changed 8 years ago by Malcolm Tredinnick

This looks like a bug / un-feature in xgettext. Very annoying. :-(

Note: See TracTickets for help on using tickets.
Back to Top