[gnome-control-center/mwleeds/region-update-locale-format] region: update the locale format along with the language when it changes
- From: Phaedrus Leeds <mwleeds src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center/mwleeds/region-update-locale-format] region: update the locale format along with the language when it changes
- Date: Wed, 26 Aug 2020 21:03:53 +0000 (UTC)
commit 45b8c5b98c66eb064ae43a4d32f9a74191ac2aab
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).
Note 2020-08-26: This patch has been in Endless OS since 2015, proposing
it upstream. - mwleeds
panels/region/cc-region-panel.c | 10 +++++++++-
1 file changed, 9 insertions(+), 1 deletion(-)
---
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index 9b59b23c4..86fcc53b1 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -377,6 +377,8 @@ update_language (CcRegionPanel *self,
}
}
+static void update_region (CcRegionPanel *self, const gchar *region);
+
static void
language_response (CcRegionPanel *self,
gint response_id,
@@ -387,6 +389,9 @@ language_response (CcRegionPanel *self,
if (response_id == GTK_RESPONSE_OK) {
language = cc_language_chooser_get_language (chooser);
update_language (self, language);
+
+ /* Keep format strings consistent with the user's language */
+ update_region (self, NULL);
}
gtk_widget_destroy (GTK_WIDGET (chooser));
@@ -414,7 +419,10 @@ update_region (CcRegionPanel *self,
} else {
if (g_strcmp0 (region, self->region) == 0)
return;
- g_settings_set_string (self->locale_settings, KEY_REGION, region);
+ if (region == NULL || region[0] == '\0')
+ g_settings_reset (self->locale_settings, KEY_REGION);
+ else
+ g_settings_set_string (self->locale_settings, KEY_REGION, region);
if (self->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]