Opened 7 years ago

Closed 3 years ago

#7564 closed Uncategorized (fixed)

Translated string with unamed arguments

Reported by: garcia_marc Owned by: permon
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 permon 7 years ago.

Download all attachments as: .zip

Change History (6)

Changed 7 years ago by permon

comment:1 Changed 7 years ago by permon

  • Has patch set
  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to permon
  • Patch needs improvement unset
  • Status changed from new to assigned
  • Triage Stage changed from Unreviewed to Ready for checkin

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

comment:2 Changed 7 years ago by brosner

  • Resolution set to fixed
  • Status changed from assigned to closed

(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 3 years ago by jacob

  • milestone 1.0 alpha deleted

Milestone 1.0 alpha deleted

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

  • Easy pickings unset
  • Resolution fixed deleted
  • Severity set to Normal
  • Status changed from closed to reopened
  • Type set to 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 3 years ago by claudep

  • Resolution set to fixed
  • Status changed from reopened to closed

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