summaryrefslogtreecommitdiff
path: root/panels/region
diff options
context:
space:
mode:
authorRui Matos <tiagomatos@gmail.com>2013-03-10 02:52:54 +0100
committerRui Matos <tiagomatos@gmail.com>2013-03-14 16:52:51 +0100
commite2163ea9ed31b2534c01864ce1db34938dd87a85 (patch)
treea7580c72101524a7c6b4e521f6b1cb49d5424873 /panels/region
parentbbc28af85d17b79ca04d07108c5cc9c5bf70f317 (diff)
downloadgnome-control-center-e2163ea9ed31b2534c01864ce1db34938dd87a85.tar.gz
region: Translate restart notification into the target language
We used to do this before the panel re-design. https://bugzilla.gnome.org/show_bug.cgi?id=695534
Diffstat (limited to 'panels/region')
-rw-r--r--panels/region/cc-region-panel.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/panels/region/cc-region-panel.c b/panels/region/cc-region-panel.c
index ea15e303f..c85c1dfc5 100644
--- a/panels/region/cc-region-panel.c
+++ b/panels/region/cc-region-panel.c
@@ -209,16 +209,23 @@ restart_now (CcRegionPanel *self)
}
static void
-show_restart_notification (CcRegionPanel *self)
+show_restart_notification (CcRegionPanel *self,
+ const gchar *locale)
{
CcRegionPanelPrivate *priv = self->priv;
GtkWidget *box;
GtkWidget *label;
GtkWidget *button;
+ gchar *current_locale;
if (priv->notification)
return;
+ if (locale) {
+ current_locale = g_strdup (setlocale (LC_MESSAGES, NULL));
+ setlocale (LC_MESSAGES, locale);
+ }
+
priv->notification = gd_notification_new ();
g_object_add_weak_pointer (G_OBJECT (priv->notification),
(gpointer *)&priv->notification);
@@ -238,6 +245,11 @@ show_restart_notification (CcRegionPanel *self)
gtk_container_add (GTK_CONTAINER (priv->notification), box);
gtk_overlay_add_overlay (GTK_OVERLAY (self->priv->overlay), priv->notification);
gtk_widget_show (priv->notification);
+
+ if (locale) {
+ setlocale (LC_MESSAGES, current_locale);
+ g_free (current_locale);
+ }
}
static void
@@ -296,7 +308,7 @@ language_response (GtkDialog *chooser,
gtk_widget_destroy (GTK_WIDGET (chooser));
if (changed)
- show_restart_notification (self);
+ show_restart_notification (self, language);
}
static gboolean
@@ -330,7 +342,7 @@ format_response (GtkDialog *chooser,
gtk_widget_destroy (GTK_WIDGET (chooser));
if (changed)
- show_restart_notification (self);
+ show_restart_notification (self, NULL);
}
static void