Error checking in python-format strings might not be working
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
New
|
Undecided
|
Unassigned |
Bug Description
I've just been pointed out to bug 409785, where a crash in language-selector was caused by a python-format string not being checked either when entering the translation in the UI or when importing the PO file.
Here are the two strings in question:
And here is the extract from the .pot file of the latest package:
#. print "%d to install, %d to remove" % (countInstall, countRemove)
#: ../LanguageSele
#, python-format
msgid "%d to install"
msgid_plural "%d to install"
msgstr[0] ""
msgstr[1] ""
#: ../LanguageSele
#, python-format
msgid "%d to remove"
msgid_plural "%d to remove"
msgstr[0] ""
msgstr[1] ""
I believe the check for the consistency of % variables is already done, but there seem to be some cases where translations with missing % variables slip through
Just for the record, so that the links to the non-%d translation is not lost when the translator fixes them, here's a screenshot of one of the strings.
The date of translation were the 2009-04-18 for both the "%d to install" one (the one causing the crash) and the "%d to remove" one.
Danilo also mentions that it'd be worth making sure that gettext does python-format checks properly as well.