[gnome-control-center/gnome-3-16] region: If language isn't set in AccountsService, show current locale



commit 0c0730995f16f089d6a0c6149fc22cc218948de9
Author: Rui Matos <tiagomatos gmail com>
Date:   Wed Aug 19 15:50:29 2015 +0200

    region: If language isn't set in AccountsService, show current locale
    
    For newly created user accounts, AccountsService won't have the
    language property set. Instead of defaulting to en_US in that case,
    let's fallback to the current locale.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=753828

 panels/region/cc-region-panel.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 2675b82..8436b68 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -624,11 +624,12 @@ static void
 update_language_from_user (CcRegionPanel *self)
 {
        CcRegionPanelPrivate *priv = self->priv;
-        const gchar *language;
+        const gchar *language = NULL;
 
         if (act_user_is_loaded (priv->user))
                 language = act_user_get_language (priv->user);
-        else
+
+        if (language == NULL || *language == '\0')
                 language = setlocale (LC_MESSAGES, NULL);
 
         g_free (priv->language);


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