[Bug 306254] [NEW] [Patch] Remaining battery time cannot be translated due to bug in i18n

Krzysztof Lichota krzysiek-launchpad.ubuntu.com at lichota.net
Mon Dec 8 15:26:17 UTC 2008


Public bug reported:

Binary package hint: kde-guidance

The KDE power manager tooltip shows untranslated message "hh:mm
remaining" and "hh:mm to charge" although the message is in .po file and
translated properly.

I have found the problem - the i18n call in source is used improperly -
i18n is applied to message _after_ substitution, not before, so message
is searched in message catalog with "hh:mm" filled in (and not found).

The following change fixes it:
--- guidance-power-manager.py.orig      2008-12-08 16:17:37.000000000 +0100
+++ guidance-power-manager.py   2008-12-08 16:15:14.000000000 +0100
@@ -682,9 +682,9 @@
             if self.batt_state == "charged":
                 blabel += i18n(" fully charged")
             elif self.batt_state == "charging":
-                blabel += i18n(" %i:%02ih to charge" % (remain_h,remain_m))
+                blabel += unicode(i18n(" %i:%02ih to charge")) % (remain_h,remain_m)
             elif self.batt_state == "discharging":
-                blabel += i18n(" %i:%02ih remaining" % (remain_h,remain_m))
+                blabel += unicode(i18n(" %i:%02ih remaining")) % (remain_h,remain_m)
             self.BattMainLabel.setText(blabel)

             # update tray icon if needed

I attach diff which fixes all similar broken i18n calls in
powermanager.py.

I have tested the change to "time remaining" and "time to charge". I
cannot test the other 2 calls as I do not have 2 cores not 2 batteries.

** Affects: kde-guidance (Ubuntu)
     Importance: Undecided
         Status: New

-- 
[Patch] Remaining battery time cannot be translated due to bug in i18n
https://bugs.launchpad.net/bugs/306254
You received this bug notification because you are a member of Kubuntu
Bugs, which is subscribed to kde-guidance in ubuntu.




More information about the kubuntu-bugs mailing list