Error checking in python-format strings might not be working

Bug #456210 reported by David Planella
6
This bug affects 1 person
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:

https://translations.launchpad.net/ubuntu/karmic/+source/language-selector/+pots/language-selector/ar/+translate?batch=10&show=all&search=%25d

And here is the extract from the .pot file of the latest package:

#. print "%d to install, %d to remove" % (countInstall, countRemove)
#: ../LanguageSelector/gtk/GtkLanguageSelector.py:406
#, python-format
msgid "%d to install"
msgid_plural "%d to install"
msgstr[0] ""
msgstr[1] ""

#: ../LanguageSelector/gtk/GtkLanguageSelector.py:407
#, 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

Revision history for this message
David Planella (dpm) wrote :

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.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.