Opened 16 years ago

Closed 13 years ago

#7564 closed Uncategorized (fixed)

Translated string with unamed arguments

Reported by: Marc Garcia Owned by: Tomáš Kopeček
Component: Internationalization Version: newforms-admin
Severity: Normal Keywords: nfa-blocker
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

When executing django/bin/make-messages.py on newforms-admin branch, next warnings are displayed:

errors happened while running xgettext on options.py
./contrib/admin/options.py:430: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                         The translator cannot reorder the arguments.
                                         Please consider using a format string with named arguments,
                                         and a mapping instead of a tuple for the arguments.
./contrib/admin/options.py:433: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                         The translator cannot reorder the arguments.
                                         Please consider using a format string with named arguments,
                                         and a mapping instead of a tuple for the arguments.
./contrib/admin/options.py:438: warning: 'msgid' format string with unnamed arguments cannot be properly localized:
                                         The translator cannot reorder the arguments.
                                         Please consider using a format string with named arguments,
                                         and a mapping instead of a tuple for the arguments.

Attachments (1)

gettext.diff (2.0 KB ) - added by Tomáš Kopeček 16 years ago.

Download all attachments as: .zip

Change History (6)

by Tomáš Kopeček, 16 years ago

Attachment: gettext.diff added

comment:1 by Tomáš Kopeček, 16 years ago

Has patch: set
Owner: changed from nobody to Tomáš Kopeček
Status: newassigned
Triage Stage: UnreviewedReady for checkin

Lines corrected, make-messages now doesn't complain.

comment:2 by Brian Rosner, 16 years ago

Resolution: fixed
Status: assignedclosed

(In [7874]) newforms-admin: Fixed #7564 -- Make position argument string interpolation use keywords instead. Works better for translators and get rid of make-messages.py warnings. Thanks Marc Garcia for the report and permon for the patch.

comment:3 by Jacob, 13 years ago

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

comment:4 by baokham.chau@…, 13 years ago

Easy pickings: unset
Resolution: fixed
Severity: Normal
Status: closedreopened
Type: Uncategorized
UI/UX: unset

System: Macbook Pro, Lion OS, Django 1.4, Python 2.7.3, xgettext 0.18.1

Still seeing the error:

Error: errors happened while running xgettext on models.py
./myproject/models.py:177: warning: 'msgid' format string with unnamed arguments cannot be properly localized:

The translator cannot reorder the arguments.
Please consider using a format string with named arguments,
and a mapping instead of a tuple for the arguments.

This happens because xgettext will still throw a warning, which will be catch by the "if errors:" block in makemessages.py. Inside the block, we will then raise an exception, regardless of whether or not this error is a fatal error or not. Suggest fix to at least look at the error level (info,warning, error, etc.) and only raise an exception if the error is fatal.

comment:5 by Claude Paroz, 13 years ago

Resolution: fixed
Status: reopenedclosed

If I understand it well, you are asking here to not raise an exception when xgettext emits warning only. Then please create a new ticket with this specific request, do not reopen old fixed issues.

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