Code

Opened 5 years ago

Closed 5 years ago

Last modified 5 years ago

#10533 closed (fixed)

Invalid format specifiers for singular and plural forms

Reported by: 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:

Description

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/options.py:745
#, 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 django-admin.py 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.

Attachments (0)

Change History (2)

comment:1 Changed 5 years ago by mtredinnick

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Resolution set to fixed
  • Status changed from new to closed

Fixed in r10081.

comment:2 Changed 5 years ago by mtredinnick

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

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.