[network-manager-pptp] ui: fix gtk_builder_set_translation_domain() calling



commit 021697afba8a0cb10ed1de47428e67a8158d6b15
Author: Ozan ÃaÄlayan <ozan pardus org tr>
Date:   Wed Aug 17 14:29:18 2011 +0300

    ui: fix gtk_builder_set_translation_domain() calling
    
    gtk_builder_set_translation_domain() should be called before
    gtk_builder_add_from_file(). This fixes UI messages always in English
    problem.

 properties/advanced-dialog.c |    2 +-
 properties/nm-pptp.c         |    4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/properties/advanced-dialog.c b/properties/advanced-dialog.c
index 3c5b23b..a71e356 100644
--- a/properties/advanced-dialog.c
+++ b/properties/advanced-dialog.c
@@ -414,6 +414,7 @@ advanced_dialog_new (GHashTable *hash)
 	ui_file = g_strdup_printf ("%s/%s", UIDIR, "nm-pptp-dialog.ui");
 	builder = gtk_builder_new ();
 
+	gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
 	if (!gtk_builder_add_from_file (builder, ui_file, &error)) {
 		g_warning ("Couldn't load builder file: %s",
 		           error ? error->message : "(unknown)");
@@ -421,7 +422,6 @@ advanced_dialog_new (GHashTable *hash)
 		g_object_unref (G_OBJECT (builder));
 		goto out;
 	}
-	gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
 
 	dialog = GTK_WIDGET (gtk_builder_get_object (builder, "pptp-advanced-dialog"));
 	if (!dialog) {
diff --git a/properties/nm-pptp.c b/properties/nm-pptp.c
index b24461a..d2303ce 100644
--- a/properties/nm-pptp.c
+++ b/properties/nm-pptp.c
@@ -404,6 +404,8 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
 	ui_file = g_strdup_printf ("%s/%s", UIDIR, "nm-pptp-dialog.ui");
 	priv->builder = gtk_builder_new ();
 
+	gtk_builder_set_translation_domain (priv->builder, GETTEXT_PACKAGE);
+
 	if (!gtk_builder_add_from_file (priv->builder, ui_file, error)) {
 		g_warning ("Couldn't load builder file: %s",
 		           error && *error ? (*error)->message : "(unknown)");
@@ -416,8 +418,6 @@ nm_vpn_plugin_ui_widget_interface_new (NMConnection *connection, GError **error)
 	}
 	g_free (ui_file);
 
-	gtk_builder_set_translation_domain (priv->builder, GETTEXT_PACKAGE);
-
 	priv->widget = GTK_WIDGET (gtk_builder_get_object (priv->builder, "pptp-vbox"));
 	if (!priv->widget) {
 		g_set_error (error, PPTP_PLUGIN_UI_ERROR, 0, "could not load UI widget");



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