[network-manager-openconnect/NM_0_8] core: add missing #include <config.h> for translations and add some translatables (cherry picked fro



commit 6253baf5478a2ecc8cec6290e5fbf15764ea90bd
Author: Kjartan Maraas <kmaraas gnome org>
Date:   Tue Mar 29 17:05:55 2011 -0500

    core: add missing #include <config.h> for translations and add some translatables
    (cherry picked from commit 35f7e3e40d3d6e5e14b52809a438dde9ee6624ef)

 auth-dialog/main.c           |   21 +++++++++++++--------
 src/nm-openconnect-service.c |   23 ++++++++++++++---------
 2 files changed, 27 insertions(+), 17 deletions(-)
---
diff --git a/auth-dialog/main.c b/auth-dialog/main.c
index f3feff9..7cae093 100644
--- a/auth-dialog/main.c
+++ b/auth-dialog/main.c
@@ -23,6 +23,10 @@
  *   Boston, MA 02110-1301 USA
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <string.h>
 #include <errno.h>
 #include <unistd.h>
@@ -35,6 +39,7 @@
 #include <gconf/gconf-client.h>
 
 #include <gtk/gtk.h>
+#include <glib/gi18n.h>
 
 #include "auth-dlg-settings.h"
 
@@ -650,8 +655,8 @@ static gboolean user_validate_cert(cert_data *data)
 	BIO_get_mem_ptr(bp, &certinfo);
 
 	title = get_title(data->ui_data->vpn_name);
-	msg = g_strdup_printf("Certificate from VPN server \"%s\" failed verification.\n"
-			      "Reason: %s\nDo you want to accept it?",
+	msg = g_strdup_printf(_("Certificate from VPN server \"%s\" failed verification.\n"
+			      "Reason: %s\nDo you want to accept it?"),
 			      openconnect_get_hostname(data->ui_data->vpninfo),
 			      data->reason);
 
@@ -1309,7 +1314,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
 	gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 
-	label = gtk_label_new("VPN host");
+	label = gtk_label_new(_("VPN host"));
 	gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
 	gtk_widget_show(label);
 
@@ -1329,7 +1334,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
 				 G_CALLBACK(queue_connect_host), ui_data);
 	gtk_widget_show(ui_data->connect_button);
 
-	autocon = gtk_check_button_new_with_label("Automatically start connecting next time");
+	autocon = gtk_check_button_new_with_label(_("Automatically start connecting next time"));
 	gtk_box_pack_start(GTK_BOX(vbox), autocon, FALSE, FALSE, 0);
 	if (get_gconf_autoconnect(gcl, config_path))
 		gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(autocon), 1);
@@ -1346,12 +1351,12 @@ static void build_main_dialog(auth_ui_data *ui_data)
 	gtk_container_add(GTK_CONTAINER(frame), frame_box);
 	gtk_widget_show(frame_box);
 
-	ui_data->no_form_label = gtk_label_new("Select a host to fetch the login form");
+	ui_data->no_form_label = gtk_label_new(_("Select a host to fetch the login form"));
 	gtk_widget_set_sensitive(ui_data->no_form_label, FALSE);
 	gtk_box_pack_start(GTK_BOX(frame_box), ui_data->no_form_label, FALSE, FALSE, 0);
 	gtk_widget_show(ui_data->no_form_label);
 
-	ui_data->getting_form_label = gtk_label_new("Contacting host, please wait...");
+	ui_data->getting_form_label = gtk_label_new(_("Contacting host, please wait..."));
 	gtk_widget_set_sensitive(ui_data->getting_form_label, FALSE);
 	gtk_box_pack_start(GTK_BOX(frame_box), ui_data->getting_form_label, FALSE, FALSE, 0);
 
@@ -1363,7 +1368,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
 	gtk_box_pack_end(GTK_BOX(frame_box), hbox, FALSE, FALSE, 0);
 	gtk_widget_show(hbox);
 
-	ui_data->login_button = gtk_button_new_with_mnemonic("_Login");
+	ui_data->login_button = gtk_button_new_with_mnemonic(_("_Login"));
 	image = gtk_image_new_from_stock(GTK_STOCK_APPLY, GTK_ICON_SIZE_BUTTON);
 	gtk_button_set_image (GTK_BUTTON(ui_data->login_button), image);
 	gtk_box_pack_end(GTK_BOX(hbox), ui_data->login_button, FALSE, FALSE, 0);
@@ -1377,7 +1382,7 @@ static void build_main_dialog(auth_ui_data *ui_data)
 	gtk_widget_set_sensitive (ui_data->cancel_button, FALSE);
 	gtk_widget_show(ui_data->cancel_button);
 
-	exp = gtk_expander_new("Log");
+	exp = gtk_expander_new(_("Log"));
 	gtk_box_pack_end(GTK_BOX(vbox), exp, FALSE, FALSE, 0);
 	gtk_widget_show(exp);
 
diff --git a/src/nm-openconnect-service.c b/src/nm-openconnect-service.c
index 05f8581..09ce5df 100644
--- a/src/nm-openconnect-service.c
+++ b/src/nm-openconnect-service.c
@@ -22,6 +22,10 @@
  *   Copyright © 2007 - 2008 Novell, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
 #include <stdio.h>
 #include <string.h>
 #include <stdlib.h>
@@ -36,6 +40,7 @@
 #include <net/if.h>
 #include <pwd.h>
 #include <grp.h>
+#include <glib/gi18n.h>
 
 #include <nm-setting-vpn.h>
 #include "nm-openconnect-service.h"
@@ -135,7 +140,7 @@ validate_one_property (const char *key, const char *value, gpointer user_data)
 			g_set_error (info->error,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-			             "invalid integer property '%s' or out of range [%d -> %d]",
+			             _("invalid integer property '%s' or out of range [%d -> %d]"),
 			             key, prop.int_min, prop.int_max);
 			break;
 		case G_TYPE_BOOLEAN:
@@ -145,14 +150,14 @@ validate_one_property (const char *key, const char *value, gpointer user_data)
 			g_set_error (info->error,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-			             "invalid boolean property '%s' (not yes or no)",
+			             _("invalid boolean property '%s' (not yes or no)"),
 			             key);
 			break;
 		default:
 			g_set_error (info->error,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-			             "unhandled property '%s' type %s",
+			             _("unhandled property '%s' type %s"),
 			             key, g_type_name (prop.type));
 			break;
 		}
@@ -163,7 +168,7 @@ validate_one_property (const char *key, const char *value, gpointer user_data)
 		g_set_error (info->error,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-		             "property '%s' invalid or not supported",
+		             _("property '%s' invalid or not supported"),
 		             key);
 	}
 }
@@ -179,7 +184,7 @@ nm_openconnect_properties_validate (NMSettingVPN *s_vpn, GError **error)
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
 		             "%s",
-		             "No VPN configuration options.");
+		             _("No VPN configuration options."));
 		return FALSE;
 	}
 
@@ -197,7 +202,7 @@ nm_openconnect_secrets_validate (NMSettingVPN *s_vpn, GError **error)
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
 		             "%s",
-		             "No VPN secrets!");
+		             _("No VPN secrets!"));
 		return FALSE;
 	}
 
@@ -277,7 +282,7 @@ nm_openconnect_start_openconnect_binary (NMOPENCONNECTPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "Could not find openconnect binary.");
+		             _("Could not find openconnect binary."));
 		return -1;
 	}
 
@@ -289,7 +294,7 @@ nm_openconnect_start_openconnect_binary (NMOPENCONNECTPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "No VPN gateway specified.");
+		             _("No VPN gateway specified."));
 		return -1;
 	}
 
@@ -299,7 +304,7 @@ nm_openconnect_start_openconnect_binary (NMOPENCONNECTPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "No WebVPN cookie provided.");
+		             _("No WebVPN cookie provided."));
 		return -1;
 	}
 	props_gwcert = nm_setting_vpn_get_secret (s_vpn, NM_OPENCONNECT_KEY_GWCERT);



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