[gnome-control-center/T20771: 14/44] region: update the locale format along with the language when it changes
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/T20771: 14/44] region: update the locale format along with the language when it changes
- Date: Tue, 23 Jan 2018 21:07:45 +0000 (UTC)
commit 1260a539af98fb05bf3d1870e2e3cb653348a0b9
Author: Mario Sanchez Prada <mario endlessm com>
Date: Thu Mar 19 17:00:08 2015 +0000
region: update the locale format along with the language when it changes
Not doing this will lead to (probably undesired) inconsistencies when
changing the language, since many locale-dependant strings will still be
rendered considering the previous language format (e.g. days of the week).
[endlessm/eos-shell#3586]
panels/region/cc-region-panel.c | 10 +++++++++-
1 files changed, 9 insertions(+), 1 deletions(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index ac1315a..d8c0794 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -362,6 +362,8 @@ update_language (CcRegionPanel *self,
}
}
+static void update_region (CcRegionPanel *self, const gchar *region);
+
static void
language_response (GtkDialog *chooser,
gint response_id,
@@ -372,6 +374,9 @@ language_response (GtkDialog *chooser,
if (response_id == GTK_RESPONSE_OK) {
language = cc_language_chooser_get_language (GTK_WIDGET (chooser));
update_language (self, language);
+
+ /* Keep format strings consistent with the user's language */
+ update_region (self, NULL);
}
gtk_widget_destroy (GTK_WIDGET (chooser));
@@ -403,7 +408,10 @@ update_region (CcRegionPanel *self,
} else {
if (g_strcmp0 (region, priv->region) == 0)
return;
- g_settings_set_string (priv->locale_settings, KEY_REGION, region);
+ if (region == NULL || region[0] == '\0')
+ g_settings_reset (priv->locale_settings, KEY_REGION);
+ else
+ g_settings_set_string (priv->locale_settings, KEY_REGION, region);
if (priv->login_auto_apply)
set_system_region (self, region);
maybe_notify (self, LC_TIME, region);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]