[gnome-control-center] common: Try to get the configured language as the current one



commit 3eb6cdd1bc26d178d3557585fefe9a9d9eaae632
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Nov 23 18:44:58 2012 +0100

    common: Try to get the configured language as the current one

 panels/common/cc-common-language.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
---
diff --git a/panels/common/cc-common-language.c b/panels/common/cc-common-language.c
index b97c557..fa59b91 100644
--- a/panels/common/cc-common-language.c
+++ b/panels/common/cc-common-language.c
@@ -34,6 +34,8 @@
 
 #include "gdm-languages.h"
 
+static char *get_lang_for_user_object_path (const char *path);
+
 static gint
 cc_common_language_sort_languages (GtkTreeModel *model,
 				   GtkTreeIter  *a,
@@ -315,8 +317,15 @@ gchar *
 cc_common_language_get_current_language (void)
 {
         gchar *language;
+        char *path;
         const gchar *locale;
 
+	path = g_strdup_printf ("/org/freedesktop/Accounts/User%d", getuid ());
+        language = get_lang_for_user_object_path (path);
+        g_free (path);
+        if (language != NULL && *language != '\0')
+                return language;
+
         locale = (const gchar *) setlocale (LC_MESSAGES, NULL);
         if (locale)
                 language = gdm_normalize_language_name (locale);



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