[gnome-control-center] Avoid using locales without language names.



commit 7cfa641feb67d6fd5ae5a86283c09e1c042ca12d
Author: Yanko Kaneti <yaneti declera com>
Date:   Thu Feb 3 20:17:34 2011 +0200

    Avoid using locales without language names.
    
    Quick and dirty fix for not using all the iso-codes resources for
    finding a suitable language name for a locale.

 panels/common/cc-common-language.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/cc-common-language.c b/panels/common/cc-common-language.c
index fd13943..fbe9ef7 100644
--- a/panels/common/cc-common-language.c
+++ b/panels/common/cc-common-language.c
@@ -206,6 +206,11 @@ cc_common_language_add_available_languages (GtkListStore *store,
 		}
 
                 language = gdm_get_language_from_name (name, NULL);
+                if (!language) {
+                        g_debug ("Ignoring '%s' as a locale, because we couldn't figure the language name", name);
+                        g_free (name);
+                        continue;
+                }
 
                 gtk_list_store_append (store, &iter);
                 gtk_list_store_set (store, &iter, LOCALE_COL, name, DISPLAY_LOCALE_COL, language, -1);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]