[network-manager-pptp/NM_0_8] core: mark some strings for translation (bgo #645909)



commit b9b0d1576e94703872971686a753484308b960f5
Author: Kjartan Maraas <kmaraas gnome org>
Date:   Tue Mar 29 16:55:46 2011 -0500

    core: mark some strings for translation (bgo #645909)

 src/nm-pptp-service.c |   43 +++++++++++++++++++++++--------------------
 1 files changed, 23 insertions(+), 20 deletions(-)
---
diff --git a/src/nm-pptp-service.c b/src/nm-pptp-service.c
index 0a7c844..cc89695 100644
--- a/src/nm-pptp-service.c
+++ b/src/nm-pptp-service.c
@@ -20,7 +20,9 @@
  * (C) Copyright 2008 - 2011 Red Hat, Inc.
  */
 
+#ifdef HAVE_CONFIG_H
 #include <config.h>
+#endif
 
 #include <stdio.h>
 #include <string.h>
@@ -40,6 +42,7 @@
 #include <arpa/inet.h>
 #include <netdb.h>
 
+#include <glib/gi18n.h>
 #include <dbus/dbus.h>
 #include <dbus/dbus-glib.h>
 
@@ -248,7 +251,7 @@ nm_pptp_ppp_service_cache_credentials (NMPptpPppService *self,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 		             "%s",
-		             "Could not find secrets (connection invalid, no vpn setting).");
+		             _("Could not find secrets (connection invalid, no vpn setting)."));
 		return FALSE;
 	}
 
@@ -261,7 +264,7 @@ nm_pptp_ppp_service_cache_credentials (NMPptpPppService *self,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 			             "%s",
-			             "Invalid VPN username.");
+			             _("Invalid VPN username."));
 			return FALSE;
 		}
 	} else {
@@ -271,7 +274,7 @@ nm_pptp_ppp_service_cache_credentials (NMPptpPppService *self,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 			             "%s",
-			             "Missing VPN username.");
+			             _("Missing VPN username."));
 			return FALSE;
 		}
 	}
@@ -282,7 +285,7 @@ nm_pptp_ppp_service_cache_credentials (NMPptpPppService *self,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 		             "%s",
-		             "Missing or invalid VPN password.");
+		             _("Missing or invalid VPN password."));
 		return FALSE;
 	}
 
@@ -310,7 +313,7 @@ impl_pptp_service_need_secrets (NMPptpPppService *self,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 		             "%s",
-		             "No cached credentials.");
+		             _("No cached credentials."));
 		goto error;
 	}
 
@@ -455,7 +458,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 gateway '%s'",
+				             _("invalid gateway '%s'"),
 				             key);
 				return;
 			}
@@ -469,7 +472,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'",
+			             _("invalid integer property '%s'"),
 			             key);
 			break;
 		case G_TYPE_BOOLEAN:
@@ -479,14 +482,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;
 		}
@@ -497,7 +500,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);
 	}
 }
@@ -515,7 +518,7 @@ nm_pptp_properties_validate (NMSettingVPN *s_vpn,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
 		             "%s",
-		             "No VPN configuration options.");
+		             _("No VPN configuration options."));
 		return FALSE;
 	}
 
@@ -535,7 +538,7 @@ nm_pptp_properties_validate (NMSettingVPN *s_vpn,
 			g_set_error (error,
 			             NM_VPN_PLUGIN_ERROR,
 			             NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
-			             "Missing required option '%s'.",
+			             _("Missing required option '%s'."),
 			             prop.name);
 			return FALSE;
 		}
@@ -555,7 +558,7 @@ nm_pptp_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;
 	}
 
@@ -695,7 +698,7 @@ construct_pppd_args (NMPptpPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "Could not find pptp client binary.");
+		             _("Could not find pptp client binary."));
 		return FALSE;
 	}
 
@@ -709,7 +712,7 @@ construct_pppd_args (NMPptpPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_CONNECTION_INVALID,
 		             "%s",
-		             "Missing VPN gateway.");
+		             _("Missing VPN gateway."));
 		goto error;
 	}
 
@@ -861,7 +864,7 @@ nm_pptp_start_pppd_binary (NMPptpPlugin *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "Could not find the pppd binary.");
+		             _("Could not find the pppd binary."));
 		return FALSE;
 	}
 
@@ -1082,7 +1085,7 @@ real_connect (NMVPNPlugin   *plugin,
 		             NM_VPN_PLUGIN_ERROR,
 		             NM_VPN_PLUGIN_ERROR_LAUNCH_FAILED,
 		             "%s",
-		             "Could not start pppd plugin helper service.");
+		             _("Could not start pppd plugin helper service."));
 		return FALSE;
 	}
 
@@ -1260,8 +1263,8 @@ main (int argc, char *argv[])
 	GOptionContext *opt_ctx = NULL;
 
 	GOptionEntry options[] = {
-		{ "persist", 0, 0, G_OPTION_ARG_NONE, &persist, "Don't quit when VPN connection terminates", NULL },
-		{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, "Enable verbose debug logging (may expose passwords)", NULL },
+		{ "persist", 0, 0, G_OPTION_ARG_NONE, &persist, N_("Don't quit when VPN connection terminates"), NULL },
+		{ "debug", 0, 0, G_OPTION_ARG_NONE, &debug, N_("Enable verbose debug logging (may expose passwords)"), NULL },
 		{NULL}
 	};
 
@@ -1275,7 +1278,7 @@ main (int argc, char *argv[])
 	g_option_context_add_main_entries (opt_ctx, options, NULL);
 
 	g_option_context_set_summary (opt_ctx,
-	    "nm-pptp-service provides integrated PPTP VPN capability (compatible with Microsoft and other implementations) to NetworkManager.");
+	    _("nm-pptp-service provides integrated PPTP VPN capability (compatible with Microsoft and other implementations) to NetworkManager."));
 
 	g_option_context_parse (opt_ctx, &argc, &argv, NULL);
 	g_option_context_free (opt_ctx);



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