Software center does not respect locale settings

Bug #444316 reported by Christian Rudh
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
software-center (Ubuntu)
Fix Released
Medium
Unassigned

Bug Description

Binary package hint: software-center

Most of the application is in english, as it should be for me, but in the list of packages both the name and the description of the packages are in swedish. Everything else in GNOME is in english for me, this is the only exception.

My /etc/environment looks like this:

PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games"
LANGUAGE="en_US:en"
LANG="en_US.UTF-8"

LC_CTYPE="sv_SE.UTF-8"
LC_NUMERIC="sv_SE.UTF-8"
LC_TIME="sv_SE.UTF-8"
LC_COLLATE="sv_SE.UTF-8"
LC_MONETARY="sv_SE.UTF-8"
LC_PAPER="sv_SE.UTF-8"
LC_NAME="sv_SE.UTF-8"
LC_ADDRESS="sv_SE.UTF-8"
LC_TELEPHONE="sv_SE.UTF-8"
LC_MEASUREMENT="sv_SE.UTF-8"

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks for your bugreport.

Could you please run:
$ python -c 'import locale; print locale.getdefaultlocale()'
and let me know what that outputs?

Changed in software-center (Ubuntu):
status: New → Incomplete
Revision history for this message
Michael Vogt (mvo) wrote :

Will synaptic display package descriptions in swedish as well or is it just software-center?

Changed in software-center (Ubuntu):
importance: Undecided → Medium
Revision history for this message
Christian Rudh (crudh) wrote :

Synaptic displays everyhing in english.

$ python -c 'import locale; print locale.getdefaultlocale()'
('sv_SE', 'UTF8')

So that returns sv_SE, don't know why. But all other apps are in english (even other python apps like Pitivi) except for the beta of Google Chrome that also shows some swedish strings.

Output of locale:

$ locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE=sv_SE.UTF-8
LC_NUMERIC=sv_SE.UTF-8
LC_TIME=sv_SE.UTF-8
LC_COLLATE=sv_SE.UTF-8
LC_MONETARY=sv_SE.UTF-8
LC_MESSAGES="en_US.UTF-8"
LC_PAPER=sv_SE.UTF-8
LC_NAME=sv_SE.UTF-8
LC_ADDRESS=sv_SE.UTF-8
LC_TELEPHONE=sv_SE.UTF-8
LC_MEASUREMENT=sv_SE.UTF-8
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=

I have configured my system to use english language, swedish keyboard and swedish measurements and dates and so on.

Revision history for this message
Michael Vogt (mvo) wrote :

Thanks, the below patch should fix it:

=== modified file 'softwarecenter/db/update.py'
--- softwarecenter/db/update.py 2009-09-30 13:32:12 +0000
+++ softwarecenter/db/update.py 2009-10-06 11:18:41 +0000
@@ -57,7 +57,7 @@
                     return translated_value
         # then try the i18n version of the key (in [de_DE] or
         # [de]
- locale = getdefaultlocale()[0]
+ locale = getdefaultlocale(('LANGUAGE','LANG','LC_CTYPE','LC_ALL'))[0]
         if locale:
             if self.has_option_desktop("%s[%s]" % (key, locale)):
                 return self.get(self.DE, "%s[%s]" % (key, locale))

I commtied it to bzr and it will be part of the next upload.

Changed in software-center (Ubuntu):
status: Incomplete → Fix Committed
Revision history for this message
Christian Rudh (crudh) wrote :

Thanks a lot!

Michael Vogt (mvo)
Changed in software-center (Ubuntu):
status: Fix Committed → Fix Released
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.