[Patch] Remaining battery time cannot be translated due to bug in i18n
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
guidance-power-manager (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
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-
+++ guidance-
@@ -682,9 +682,9 @@
if self.batt_state == "charged":
elif self.batt_state == "charging":
- blabel += i18n(" %i:%02ih to charge" % (remain_
+ blabel += unicode(i18n(" %i:%02ih to charge")) % (remain_h,remain_m)
elif self.batt_state == "discharging":
- blabel += i18n(" %i:%02ih remaining" % (remain_
+ blabel += unicode(i18n(" %i:%02ih remaining")) % (remain_h,remain_m)
# 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.
Are the fixes upstream already?