[gnome-control-center] region: Set LC_ specific variables, not LC_ALL
- From: Rodrigo Moya <rodrigo src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-control-center] region: Set LC_ specific variables, not LC_ALL
- Date: Thu, 7 Jul 2011 16:24:30 +0000 (UTC)
commit 46c1dfe6646bfdee7bdeafe5af945ea086071acb
Author: Rodrigo Moya <rodrigo gnome-db org>
Date: Thu Jul 7 18:20:56 2011 +0200
region: Set LC_ specific variables, not LC_ALL
panels/region/gnome-region-panel-formats.c | 14 +++++++++++---
panels/region/gnome-region-panel.ui | 12 ++++++++++++
2 files changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/panels/region/gnome-region-panel-formats.c b/panels/region/gnome-region-panel-formats.c
index 12c66ab..53c28d7 100644
--- a/panels/region/gnome-region-panel-formats.c
+++ b/panels/region/gnome-region-panel-formats.c
@@ -50,10 +50,10 @@ selection_changed_cb (GtkComboBox *combo, gpointer user_data)
GtkBuilder *builder = GTK_BUILDER (user_data);
active_id = gtk_combo_box_get_active_id (combo);
- if (!active_id)
+ if (!active_id || !active_id[0])
return;
- locale = setlocale (LC_ALL, active_id);
+ locale = setlocale (LC_TIME, active_id);
dt = g_date_time_new_now_local ();
@@ -67,18 +67,26 @@ selection_changed_cb (GtkComboBox *combo, gpointer user_data)
display_date (GTK_LABEL (gtk_builder_get_object (builder, "full_time_format")), dt, "%r %Z");
display_date (GTK_LABEL (gtk_builder_get_object (builder, "short_time_format")), dt, "%X");
+ setlocale (LC_TIME, locale);
+
/* Display numbers */
+ locale = setlocale (LC_NUMERIC, active_id);
+
s = g_strdup_printf ("%'.2f", 123456789.00);
gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "numbers_format")), s);
g_free (s);
+ setlocale (LC_NUMERIC, locale);
+
/* Display currency and measurement */
+ locale = setlocale (LC_MONETARY, active_id);
+
num_info = localeconv ();
if (num_info != NULL) {
gtk_label_set_text (GTK_LABEL (gtk_builder_get_object (builder, "currency_format")), num_info->currency_symbol);
}
- setlocale (LC_ALL, locale);
+ setlocale (LC_MONETARY, locale);
}
void
diff --git a/panels/region/gnome-region-panel.ui b/panels/region/gnome-region-panel.ui
index e3e62b7..704c4d4 100644
--- a/panels/region/gnome-region-panel.ui
+++ b/panels/region/gnome-region-panel.ui
@@ -916,6 +916,7 @@ default settings</property>
<packing>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -929,6 +930,7 @@ default settings</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -943,6 +945,7 @@ default settings</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -958,6 +961,7 @@ default settings</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -972,6 +976,7 @@ default settings</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -987,6 +992,7 @@ default settings</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
</object>
@@ -1039,6 +1045,7 @@ default settings</property>
<packing>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -1052,6 +1059,7 @@ default settings</property>
<property name="right_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -1066,6 +1074,7 @@ default settings</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -1081,6 +1090,7 @@ default settings</property>
<property name="bottom_attach">2</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -1095,6 +1105,7 @@ default settings</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
<child>
@@ -1110,6 +1121,7 @@ default settings</property>
<property name="bottom_attach">3</property>
<property name="y_options">GTK_FILL</property>
<property name="x_padding">3</property>
+ <property name="y_padding">3</property>
</packing>
</child>
</object>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]