|
|
13f8958 |
--- a/usr/lib/linuxmint/mintlocale/mintlocale.py
|
|
|
13f8958 |
+++ b/usr/lib/linuxmint/mintlocale/mintlocale.py
|
|
|
db4e60a |
@@ -279,7 +279,7 @@
|
|
|
13f8958 |
vbox = Gtk.VBox()
|
|
|
13f8958 |
vbox.pack_start(image, False, False, 2)
|
|
|
13f8958 |
label = Gtk.Label()
|
|
|
13f8958 |
- label.set_markup(title)
|
|
|
13f8958 |
+ label.set_text(title)
|
|
|
13f8958 |
vbox.pack_start(label, False, False, 2)
|
|
|
13f8958 |
menuitem.add(vbox)
|
|
|
13f8958 |
else:
|
|
|
db4e60a |
@@ -720,7 +720,10 @@
|
|
|
13f8958 |
vars[var_name] = value
|
|
|
13f8958 |
if "LANG" in vars:
|
|
|
13f8958 |
locale = vars['LANG'].replace('"', '').replace("'", "")
|
|
|
13f8958 |
- locale = locale.split(".")[0].strip()
|
|
|
13f8958 |
+ locale = locale.replace("utf8", "UTF-8")
|
|
|
13f8958 |
+ locale = locale.replace("UTF-8", "")
|
|
|
13f8958 |
+ locale = locale.replace(".", "")
|
|
|
13f8958 |
+ locale = locale.strip()
|
|
|
13f8958 |
if "_" in locale:
|
|
|
13f8958 |
split = locale.split("_")
|
|
|
13f8958 |
if len(split) == 2:
|
|
|
db4e60a |
@@ -745,7 +748,10 @@
|
|
|
13f8958 |
|
|
|
13f8958 |
if "LC_NUMERIC" in vars:
|
|
|
13f8958 |
locale = vars['LC_NUMERIC'].replace('"', '').replace("'", "")
|
|
|
13f8958 |
- locale = locale.split(".")[0].strip()
|
|
|
13f8958 |
+ locale = locale.replace("utf8", "UTF-8")
|
|
|
13f8958 |
+ locale = locale.replace("UTF-8", "")
|
|
|
13f8958 |
+ locale = locale.replace(".", "")
|
|
|
13f8958 |
+ locale = locale.strip()
|
|
|
13f8958 |
if "_" in locale:
|
|
|
13f8958 |
split = locale.split("_")
|
|
|
13f8958 |
if len(split) == 2:
|
|
|
db4e60a |
@@ -773,7 +779,7 @@
|
|
|
13f8958 |
self.system_label.set_markup("%s\n<small>%s %s\n%s %s</small>" % (_("System locale"), language_prefix, language_str, region_prefix, region_str))
|
|
|
13f8958 |
|
|
|
13f8958 |
def set_num_installed(self):
|
|
|
f99be51 |
- num_installed = int(subprocess.check_output("localedef --list-archive | wc -l", shell=True))
|
|
|
f99be51 |
+ num_installed = int(subprocess.check_output("localedef --list-archive | grep utf8 | wc -l", shell=True))
|
|
|
f99be51 |
self.install_label.set_markup("%s\n<small>%s</small>" % (_("Language support"), gettext.ngettext("%d language installed", "%d languages installed", num_installed) % num_installed))
|
|
|
13f8958 |
|
|
|
13f8958 |
def accountservice_ready(self, user, param):
|
|
|
db4e60a |
@@ -827,11 +833,12 @@
|
|
|
db4e60a |
built_locales = {}
|
|
|
db4e60a |
for line in locales.rstrip().split("\n"):
|
|
|
13f8958 |
line = line.replace("utf8", "UTF-8")
|
|
|
13f8958 |
- cur_index += 1
|
|
|
13f8958 |
- locale_code = line.split(".")[0].strip()
|
|
|
13f8958 |
- charmap = None
|
|
|
13f8958 |
- if len(line.split(".")) > 1:
|
|
|
13f8958 |
- charmap = line.split(".")[1].strip()
|
|
|
13f8958 |
+ if "UTF-8" not in line:
|
|
|
13f8958 |
+ continue
|
|
|
13f8958 |
+ cur_index += 1
|
|
|
13f8958 |
+ locale_code = line.replace("UTF-8", "")
|
|
|
13f8958 |
+ locale_code = locale_code.replace(".", "")
|
|
|
13f8958 |
+ locale_code = locale_code.strip()
|
|
|
13f8958 |
|
|
|
13f8958 |
if "_" in locale_code:
|
|
|
13f8958 |
split = locale_code.split("_")
|
|
|
db4e60a |
@@ -843,16 +850,13 @@
|
|
|
13f8958 |
else:
|
|
|
13f8958 |
language = language_code
|
|
|
13f8958 |
|
|
|
13f8958 |
- country_code = split[1].lower().split('@')[0].strip()
|
|
|
13f8958 |
+ country_code = split[1].lower()
|
|
|
13f8958 |
if country_code in self.countries:
|
|
|
13f8958 |
country = self.countries[country_code]
|
|
|
13f8958 |
else:
|
|
|
13f8958 |
country = country_code
|
|
|
f99be51 |
|
|
|
13f8958 |
- if '@' in split[1]:
|
|
|
f99be51 |
- language_label = u"%s (@%s), %s" % (language, split[1].split('@')[1].strip(), country)
|
|
|
13f8958 |
- else:
|
|
|
f99be51 |
- language_label = u"%s, %s" % (language, country)
|
|
|
f99be51 |
+ language_label = u"%s, %s" % (language, country)
|
|
|
13f8958 |
|
|
|
13f8958 |
flag_path = FLAG_PATH % country_code
|
|
|
13f8958 |
else:
|
|
|
db4e60a |
@@ -864,9 +868,6 @@
|
|
|
13f8958 |
|
|
|
13f8958 |
flag_path = self.set_minority_language_flag_path(locale_code, flag_path)
|
|
|
13f8958 |
|
|
|
13f8958 |
- if charmap is not None and not all_locales_are_utf8:
|
|
|
f99be51 |
- language_label = u"%s <small>%s</small>" % (language_label, charmap)
|
|
|
13f8958 |
-
|
|
|
13f8958 |
if os.path.exists(flag_path):
|
|
|
13f8958 |
flag = flag_path
|
|
|
13f8958 |
else:
|
|
|
db4e60a |
@@ -892,7 +893,7 @@
|
|
|
13f8958 |
|
|
|
13f8958 |
def set_user_locale(self, path, locale):
|
|
|
13f8958 |
self.locale_button.set_button_label(locale.name)
|
|
|
f99be51 |
- print(u"Setting language to %s" % locale.id)
|
|
|
075b923 |
+ print(u"Setting language to '%s' '%s'" % (locale.name, locale.id))
|
|
|
13f8958 |
# Set it in Accounts Service
|
|
|
13f8958 |
try:
|
|
|
13f8958 |
self.accountService.set_language(locale.id)
|
|
|
db4e60a |
@@ -916,7 +917,7 @@
|
|
|
13f8958 |
|
|
|
13f8958 |
def set_user_region(self, path, locale):
|
|
|
13f8958 |
self.region_button.set_button_label(locale.name)
|
|
|
f99be51 |
- print("Setting region to %s" % locale.id)
|
|
|
075b923 |
+ print("Setting region to '%s' '%s'" % (locale.name, locale.id))
|
|
|
13f8958 |
|
|
|
13f8958 |
# We don't call self.accountService.set_formats_locale(locale.id) here...
|
|
|
13f8958 |
# First, we don't really use AccountsService, we're only doing this to be nice to LightDM and all..
|
|
|
13f8958 |
|