Error-prone translatable variable names

Bug #621723 reported by Gabor Kelemen on 2010-08-21
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu Translations
High
Unassigned
computer-janitor (Ubuntu)
High
Barry Warsaw

Bug Description

Binary package hint: computer-janitor

We have these variable names in Computer Janitor:

<b>Software packages to remove: {packages}</b>.
Located in ../computerjanitorapp/gtk/dialogs.py:68

Non-package items to remove: {others}.
Located in ../computerjanitorapp/gtk/dialogs.py:74

Size: {bytes}
Located in ../computerjanitorapp/gtk/ui.py:265

Processing {cruft}
Located in ../computerjanitorapp/gtk/ui.py:347

Computer Janitor {version}
Located in ../computerjanitorapp/cli/main.py:59

Now, the problem with these is that the current localization tools do not check the integrity of these, so I can translate the text between the {} as I wish:
https://translations.launchpad.net/ubuntu/maverick/+source/computer-janitor/+pots/computerjanitor/hu/12/+translate

If I'm not mistaken, this could cause serious problems, like application crashes. Please replace these variables with standard %s's, that way inexperienced translators can't shoot themselves in the foot.

El ds 21 de 08 de 2010 a les 11:48 +0000, en/na Gabor Kelemen va
escriure:
> Public bug reported:
>
> Binary package hint: computer-janitor
>
> We have these variable names in Computer Janitor:
>
> <b>Software packages to remove: {packages}</b>.
> Located in ../computerjanitorapp/gtk/dialogs.py:68
>
> Non-package items to remove: {others}.
> Located in ../computerjanitorapp/gtk/dialogs.py:74
>
> Size: {bytes}
> Located in ../computerjanitorapp/gtk/ui.py:265
>
> Processing {cruft}
> Located in ../computerjanitorapp/gtk/ui.py:347
>
> Computer Janitor {version}
> Located in ../computerjanitorapp/cli/main.py:59
>
> Now, the problem with these is that the current localization tools do not check the integrity of these, so I can translate the text between the {} as I wish:
> https://translations.launchpad.net/ubuntu/maverick/+source/computer-janitor/+pots/computerjanitor/hu/12/+translate
>
> If I'm not mistaken, this could cause serious problems, like application
> crashes. Please replace these variables with standard %s's, that way
> inexperienced translators can't shoot themselves in the foot.
>

That's correct. If I'm not mistaken, that is the new way of specifying
named arguments in Python strings. That's all and well, except that it's
not supported by gettext yet, in the sense that the gettext tools do not
recognise such strings as python-format and they cannot be validated.

 affects ubuntu-translations
 importance high
 status triaged

Changed in ubuntu-translations:
importance: Undecided → High
status: New → Triaged
Barry Warsaw (barry) on 2010-08-23
Changed in computer-janitor (Ubuntu):
status: New → Confirmed
status: Confirmed → Triaged
importance: Undecided → High
assignee: nobody → Barry Warsaw (barry)
milestone: none → ubuntu-10.10-beta
Barry Warsaw (barry) wrote :

%(foo)s must die. It's a horrible ui and consistently trips up translators. However, gettext and Launchpad do not yet support the other better formats, so it's reasonable to change these back to %s format for now, because without the content checking that gettext does, the worse effect will be broken ui.

David's agreed on IRC to file an upstream gettext bug to support PEP 292 and 3101 style string substitutions. We'll defer this bug until upstream and LP support the newer formats.

Barry Warsaw (barry) wrote :

Um, not defer *this* bug, but the new bug I'm about to file to turn %s back into {foo} or $foo. ;)

Barry Warsaw (barry) wrote :

See bug 622720 for the tracker for %(foo)s -> $foo issue.

Launchpad Janitor (janitor) wrote :

This bug was fixed in the package computer-janitor - 2.0.3-0ubuntu1

---------------
computer-janitor (2.0.3-0ubuntu1) maverick; urgency=low

  * Fixes for translation support.
    - Turn {foo} string substitutions back into %(foo)s strings since
      gettext does not yet support validation of {foo} or $foo
      substitutions. (LP: #621723)
    - Ensure that POTFILES.in has the proper type information for the
      ComputerJanitor.ui file. (LP: #612493)
 -- Barry Warsaw <email address hidden> Tue, 24 Aug 2010 11:00:14 -0400

Changed in computer-janitor (Ubuntu):
status: Triaged → Fix Released
Barry Warsaw (barry) on 2010-08-24
Changed in computer-janitor (Ubuntu):
status: Fix Released → Fix Committed
Barry Warsaw (barry) on 2010-08-24
Changed in computer-janitor (Ubuntu):
status: Fix Committed → Fix Released
David Planella (dpm) wrote :

The new POT template is in the queue and will be imported soon. I've had a look at it and all the variable names there match the change in this bug, thus marking the translations task as Fix Released as well. Thanks Barry!

Changed in ubuntu-translations:
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers