common: ensure the current language has a display name in the model
https://bugzilla.gnome.org/show_bug.cgi?id=702344
This commit is contained in:
parent
790d213219
commit
0221ffefa1
1 changed files with 8 additions and 1 deletions
|
@ -601,6 +601,9 @@ insert_language (GHashTable *ht,
|
|||
|
||||
g_debug ("We have translations for %s", lang);
|
||||
|
||||
if (g_str_has_suffix (lang, ".utf8"))
|
||||
key = g_strdup (lang);
|
||||
else
|
||||
key = g_strdup_printf ("%s.utf8", lang);
|
||||
|
||||
label_own_lang = gnome_get_language_from_locale (key, key);
|
||||
|
@ -738,6 +741,10 @@ cc_common_language_add_user_languages (GtkTreeModel *model)
|
|||
/* Add the current locale first */
|
||||
name = cc_common_language_get_current_language ();
|
||||
display = g_hash_table_lookup (user_langs, name);
|
||||
if (!display) {
|
||||
insert_language (user_langs, name);
|
||||
display = g_hash_table_lookup (user_langs, name);
|
||||
}
|
||||
|
||||
gtk_list_store_append (store, &iter);
|
||||
gtk_list_store_set (store, &iter, LOCALE_COL, name, DISPLAY_LOCALE_COL, display, -1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue