Opened 8 years ago

Closed 4 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 8 years ago.

Download all attachments as: .zip

Change History (6)

Changed 8 years ago by Tomáš Kopeček

Attachment: gettext.diff added

comment:1 Changed 8 years ago by Tomáš Kopeček

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 Changed 8 years ago by Brian Rosner

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 Changed 5 years ago by Jacob

milestone: 1.0 alpha

Milestone 1.0 alpha deleted

comment:4 Changed 4 years ago by baokham.chau@…

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 Changed 4 years ago by Claude Paroz

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