Merge lp:~mvo/software-center/lp967036-2 into lp:software-center/5.2

Proposed by Michael Vogt
Status: Merged
Merged at revision: 3046
Proposed branch: lp:~mvo/software-center/lp967036-2
Merge into: lp:software-center/5.2
Diff against target: 21 lines (+4/-1)
1 file modified
softwarecenter/ui/gtk3/widgets/labels.py (+4/-1)
To merge this branch: bzr merge lp:~mvo/software-center/lp967036-2
Reviewer Review Type Date Requested Status
Gary Lasker (community) Approve
Review via email: mp+108707@code.launchpad.net

Description of the change

This fixes the crash #967036 for people running with the LANGUAGE=zh_CN.UTF-8 or zh_TW.UTF-8

To reproduce:
1. install chinese support via gnome-language-selector
2. run LANGUAGE=zh_CN.UTF-8 software-center ryzom
3. verify the crash (and that the UI looks chinese)

4. use this branch and run
5. LANGUAGE=zh_CN.UTF-8 software-center ryzom
6. verify that it works (and that all UI looks chinese)

To post a comment you must log in.
Revision history for this message
Gary Lasker (gary-lasker) wrote :

Sweet fix, does the trick! Many thanks, mvo.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'softwarecenter/ui/gtk3/widgets/labels.py'
--- softwarecenter/ui/gtk3/widgets/labels.py 2012-04-12 08:10:15 +0000
+++ softwarecenter/ui/gtk3/widgets/labels.py 2012-06-05 09:21:20 +0000
@@ -70,13 +70,16 @@
70 else:70 else:
71 label_text = self.LABEL71 label_text = self.LABEL
72 short_descr = get_hw_short_description(self.tag)72 short_descr = get_hw_short_description(self.tag)
73 return _(label_text) % {73 # this needs to be unicode as the translation for zh_CN contains
74 # special chars for the "," (LP: #967036)
75 label_text = unicode(_(label_text), "utf8", "ignore") % {
74 "sym": sym,76 "sym": sym,
75 # we need unicode() here instead of utf8 or str because77 # we need unicode() here instead of utf8 or str because
76 # the %s in "label_text" will cause str() to be called on the78 # the %s in "label_text" will cause str() to be called on the
77 # encoded string, but it will not know what encoding to use79 # encoded string, but it will not know what encoding to use
78 "hardware": unicode(short_descr, "utf8", "ignore")80 "hardware": unicode(short_descr, "utf8", "ignore")
79 }81 }
82 return label_text
8083
81 def set_hardware_requirement(self, tag, result):84 def set_hardware_requirement(self, tag, result):
82 self.tag = tag85 self.tag = tag

Subscribers

People subscribed via source and target branches