classification
Title: optparse uses %s in gettext calls
Type: behavior Stage: commit review
Components: Library (Lib) Versions: Python 3.3
process
Status: Resolution:
Dependencies: use proper gettext plurals forms in argparse and optparse
View: 4391
Superseder:
Assigned To: eric.araujo Nosy List: eric.araujo, georg.brandl, gward
Priority: normal Keywords: patch

Created on 2010-12-23 23:59 by eric.araujo, last changed 2011-05-26 16:43 by eric.araujo.

Files
File name Uploaded Description Edit
fix-gettext-positionals.diff eric.araujo, 2010-12-23 23:59
Messages (3)
msg124578 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-23 23:59
When you run xgettext other optparse.py, you get this 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.”

Attached patch fixes the incorrect calls (my patch for #4391 already fixes two of them).

See similar bug and fix for argparse in #10528.  Georg, please tell if this can go into 3.2.
msg124774 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-12-28 09:38
Hmm, argparse is new, so that is a different story.  Not so sure about optparse, so I would not put this into 3.2.
msg124817 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2010-12-28 21:05
argparse is not new if you consider that it’s present in 2.7.
History
Date User Action Args
2011-05-26 16:43:07eric.araujosetstatus: open ->
versions: + Python 3.3, - Python 3.2
2010-12-28 21:05:09eric.araujosetmessages: + msg124817
2010-12-28 09:38:37georg.brandlsetmessages: + msg124774
2010-12-23 23:59:22eric.araujosetdependencies: + use proper gettext plurals forms in argparse and optparse
2010-12-23 23:59:08eric.araujocreate