Opened 12 years ago
Closed 12 years ago
#18479 closed Cleanup/optimization (fixed)
xgettext warnings cause the makemessages command to raise an exception
Reported by: | anonymous | Owned by: | Claude Paroz |
---|---|---|---|
Component: | Internationalization | Version: | 1.4 |
Severity: | Normal | Keywords: | |
Cc: | niels.busch@… | Triage Stage: | Accepted |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Related to ticket #7564, in that the messages thrown are the same.
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.
Change History (5)
comment:1 by , 12 years ago
Owner: | changed from | to
---|
comment:2 by , 12 years ago
Triage Stage: | Unreviewed → Accepted |
---|---|
Type: | Uncategorized → Cleanup/optimization |
comment:3 by , 12 years ago
Cc: | added |
---|
I added a pull request for this ticket here: https://github.com/nsb/django/tree/ticket_18479
comment:4 by , 12 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
comment:5 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Agreed, we should only raise CommandError if the status code of the executed command is != 0. The _popen function should get and return p.returncode.