/cpw/tomkiewicz/masterpassword: 73d122f25f2b: Localize strings

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Tue May 14 13:04:53 EDT 2013


Changeset: 73d122f25f2b072bc109235a1c68883d4756dc28
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2013-05-14 19:04 +0200
Branch:	 soc.2008.masterpassword
URL: https://hg.pidgin.im/cpw/tomkiewicz/masterpassword/rev/73d122f25f2b

Description:

Localize strings

diffstat:

 libpurple/keyring.c                          |  29 ++++++++++++++-------------
 libpurple/plugins/keyrings/gnomekeyring.c    |  18 ++++++++--------
 libpurple/plugins/keyrings/internalkeyring.c |   7 +++--
 libpurple/plugins/keyrings/kwallet.cpp       |   4 +-
 libpurple/plugins/keyrings/secretservice.c   |   2 +-
 libpurple/plugins/keyrings/wincred.c         |  23 +++++++++++----------
 libpurple/plugins/perl/perl-handlers.h       |   2 +-
 7 files changed, 44 insertions(+), 41 deletions(-)

diffs (truncated from 331 to 300 lines):

diff --git a/libpurple/keyring.c b/libpurple/keyring.c
--- a/libpurple/keyring.c
+++ b/libpurple/keyring.c
@@ -247,7 +247,7 @@ purple_keyring_set_inuse_drop_cb(gpointe
 	if (tracker->error == NULL) {
 		tracker->error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_UNKNOWN,
-			"Unknown error has occured");
+			_("An unknown error has occured."));
 	}
 
 	if (tracker->cb != NULL)
@@ -379,7 +379,8 @@ purple_keyring_set_inuse(PurpleKeyring *
 			return;
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_INTERNAL,
-			"There is a password migration session already running");
+			_("There is a password migration session already "
+			"running."));
 		cb(error, data);
 		g_error_free(error);
 		return;
@@ -675,7 +676,7 @@ purple_keyring_import_password(PurpleAcc
 		if (error != NULL) {
 			*error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_BACKENDFAIL,
-				"Specified keyring is not registered.");
+				_("Specified keyring is not registered."));
 		}
 		purple_debug_warning("Keyring", "Specified keyring is not "
 			"registered, cannot import password info for account "
@@ -689,8 +690,8 @@ purple_keyring_import_password(PurpleAcc
 		if (error != NULL) {
 			*error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_NOKEYRING,
-				"No keyring loaded, cannot import password "
-				"info");
+				_("No keyring loaded, cannot import password "
+				"info."));
 		}
 		purple_debug_warning("Keyring",
 			"No keyring loaded, cannot import password info for "
@@ -709,8 +710,8 @@ purple_keyring_import_password(PurpleAcc
 		if (error != NULL) {
 			*error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_INTERNAL,
-				"Specified keyring id does not match the "
-				"loaded one.");
+				_("Specified keyring id does not match the "
+				"loaded one."));
 		}
 		purple_debug_error("keyring",
 			"Specified keyring %s is not currently used (%s). "
@@ -755,8 +756,8 @@ purple_keyring_export_password(PurpleAcc
 		if (import == NULL) {
 			*error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_NOKEYRING,
-				"No keyring configured, cannot export password "
-				"info");
+				_("No keyring configured, cannot export "
+				"password info."));
 			purple_debug_warning("keyring",
 				"No keyring configured, cannot export password "
 				"info.\n");
@@ -816,7 +817,7 @@ purple_keyring_get_password(PurpleAccoun
 			return;
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_INTERNAL,
-			"Cannot request a password while quitting.");
+			_("Cannot request a password while quitting."));
 		cb(account, NULL, error, data);
 		g_error_free(error);
 		return;
@@ -831,7 +832,7 @@ purple_keyring_get_password(PurpleAccoun
 
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_NOKEYRING,
-			"No keyring configured.");
+			_("No keyring configured."));
 		cb(account, NULL, error, data);
 		g_error_free(error);
 	}
@@ -892,7 +893,7 @@ purple_keyring_set_password(PurpleAccoun
 			return;
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_INTERNAL,
-			"Cannot save a password while quitting.");
+			_("Cannot save a password while quitting."));
 		cb(account, error, data);
 		g_error_free(error);
 		return;
@@ -905,7 +906,7 @@ purple_keyring_set_password(PurpleAccoun
 			return;
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_INTERNAL,
-			"Cannot save a password during password migration.");
+			_("Cannot save a password during password migration."));
 		cb(account, error, data);
 		g_error_free(error);
 		return;
@@ -917,7 +918,7 @@ purple_keyring_set_password(PurpleAccoun
 			return;
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_NOKEYRING,
-			"No keyring configured.");
+			_("No keyring configured."));
 		cb(account, error, data);
 		g_error_free(error);
 		return;
diff --git a/libpurple/plugins/keyrings/gnomekeyring.c b/libpurple/plugins/keyrings/gnomekeyring.c
--- a/libpurple/plugins/keyrings/gnomekeyring.c
+++ b/libpurple/plugins/keyrings/gnomekeyring.c
@@ -99,28 +99,28 @@ gnomekeyring_read_cb(GnomeKeyringResult 
 	} else if (result == GNOME_KEYRING_RESULT_NO_MATCH) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_NOPASSWORD,
-			"No password found for account");
+			_("No password found for account."));
 	} else if (result == GNOME_KEYRING_RESULT_DENIED ||
 		result == GNOME_KEYRING_RESULT_CANCELLED) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_ACCESSDENIED,
-			"Access denied");
+			_("Access denied."));
 		gnomekeyring_cancel_queue();
 	} else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
 		GNOME_KEYRING_RESULT_IO_ERROR) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Communication with GNOME Keyring failed");
+			_("Communication with GNOME Keyring failed."));
 	} else {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Unknown error (code: %d)", result);
+			_("Unknown error (code: %d)."), result);
 	}
 
 	if (error == NULL && password == NULL) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Unknown error (password empty)");
+			_("Unknown error (password empty)."));
 	}
 
 	if (error == NULL) {
@@ -177,17 +177,17 @@ gnomekeyring_save_cb(GnomeKeyringResult 
 		result == GNOME_KEYRING_RESULT_CANCELLED) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_ACCESSDENIED,
-			"Access denied");
+			_("Access denied."));
 		gnomekeyring_cancel_queue();
 	} else if (result == GNOME_KEYRING_RESULT_NO_KEYRING_DAEMON ||
 		GNOME_KEYRING_RESULT_IO_ERROR) {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Communication with GNOME Keyring failed");
+			_("Communication with GNOME Keyring failed."));
 	} else {
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Unknown error (code: %d)", result);
+			_("Unknown error (code: %d)."), result);
 	}
 
 	if (already_removed) {
@@ -238,7 +238,7 @@ gnomekeyring_request_cancel(gpointer _re
 	account = req->account;
 	error = g_error_new(PURPLE_KEYRING_ERROR,
 		PURPLE_KEYRING_ERROR_CANCELLED,
-		"Operation cancelled");
+		_("Operation cancelled."));
 	if (req->type == GNOMEKEYRING_REQUEST_READ && req->cb.read)
 		req->cb.read(account, NULL, error, req->cb_data);
 	if (req->type == GNOMEKEYRING_REQUEST_SAVE && req->cb.save)
diff --git a/libpurple/plugins/keyrings/internalkeyring.c b/libpurple/plugins/keyrings/internalkeyring.c
--- a/libpurple/plugins/keyrings/internalkeyring.c
+++ b/libpurple/plugins/keyrings/internalkeyring.c
@@ -419,7 +419,7 @@ intkeyring_process_queue(void)
 		else if (req->cb.read != NULL /* || req->cb.write != NULL */ ) {
 			GError *error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_CANCELLED,
-				"Operation cancelled.");
+				_("Operation cancelled."));
 			if (req->type == INTKEYRING_REQUEST_READ) {
 				req->cb.read(req->account, NULL, error,
 					req->cb_data);
@@ -656,7 +656,8 @@ intkeyring_read(PurpleAccount *account, 
 				purple_account_get_protocol_id(account));
 		}
 		error = g_error_new(PURPLE_KEYRING_ERROR,
-			PURPLE_KEYRING_ERROR_NOPASSWORD, "Password not found.");
+			PURPLE_KEYRING_ERROR_NOPASSWORD,
+			_("Password not found."));
 		if (cb != NULL)
 			cb(account, NULL, error, data);
 		g_error_free(error);
@@ -776,7 +777,7 @@ intkeyring_import_password(PurpleAccount
 		if (error != NULL) {
 			*error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_BACKENDFAIL,
-				"Invalid password storage mode");
+				_("Invalid password storage mode."));
 		}
 		return FALSE;
 	}
diff --git a/libpurple/plugins/keyrings/kwallet.cpp b/libpurple/plugins/keyrings/kwallet.cpp
--- a/libpurple/plugins/keyrings/kwallet.cpp
+++ b/libpurple/plugins/keyrings/kwallet.cpp
@@ -341,7 +341,7 @@ KWalletPlugin::save_request::detailedAbo
 		return;
 
 	gerror = g_error_new(PURPLE_KEYRING_ERROR, error,
-		"Failed to save password");
+		_("Failed to save password."));
 	callback(account, gerror, data);
 	g_error_free(gerror);
 }
@@ -354,7 +354,7 @@ KWalletPlugin::read_request::detailedAbo
 		return;
 
 	gerror = g_error_new(PURPLE_KEYRING_ERROR, error,
-		"Failed to read password");
+		_("Failed to read password."));
 	callback(account, NULL, gerror, data);
 	g_error_free(gerror);
 }
diff --git a/libpurple/plugins/keyrings/secretservice.c b/libpurple/plugins/keyrings/secretservice.c
--- a/libpurple/plugins/keyrings/secretservice.c
+++ b/libpurple/plugins/keyrings/secretservice.c
@@ -18,7 +18,7 @@
  *
  * You should have received a copy of the GNU General Public License
  * along with this program ; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301 USA
  */
 
 #error "This keyring needs some more work (see TODO)"
diff --git a/libpurple/plugins/keyrings/wincred.c b/libpurple/plugins/keyrings/wincred.c
--- a/libpurple/plugins/keyrings/wincred.c
+++ b/libpurple/plugins/keyrings/wincred.c
@@ -91,21 +91,22 @@ wincred_read(PurpleAccount *account, Pur
 			}
 			error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_NOPASSWORD,
-				"Password not found.");
+				_("Password not found."));
 		} else if (error_code == ERROR_NO_SUCH_LOGON_SESSION) {
 			purple_debug_error("keyring-wincred",
 				"Cannot read password, no valid logon "
 				"session\n");
 			error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_ACCESSDENIED,
-				"Cannot read password, no valid logon session");
+				_("Cannot read password, no valid logon "
+				"session."));
 		} else {
 			purple_debug_error("keyring-wincred",
 				"Cannot read password, error %lx\n",
 				error_code);
 			error = g_error_new(PURPLE_KEYRING_ERROR,
 				PURPLE_KEYRING_ERROR_BACKENDFAIL,
-				"Cannot read password, error %lx", error_code);
+				_("Cannot read password (error %lx)."), error_code);
 		}
 
 		if (cb != NULL)
@@ -126,10 +127,10 @@ wincred_read(PurpleAccount *account, Pur
 			"Cannot convert password\n");
 		error = g_error_new(PURPLE_KEYRING_ERROR,
 			PURPLE_KEYRING_ERROR_BACKENDFAIL,
-			"Cannot convert password");
+			_("Cannot read password (unicode error)."));
 	} else {
 		purple_debug_misc("keyring-wincred",
-			"Got password for account %s.\n",
+			_("Got password for account %s.\n"),
 			purple_account_get_username(account));
 	}
 
@@ -178,15 +179,15 @@ wincred_save(PurpleAccount *account, con
 					"logon session\n");
 				error = g_error_new(PURPLE_KEYRING_ERROR,
 					PURPLE_KEYRING_ERROR_ACCESSDENIED,
-					"Cannot remove password, no valid "
-					"logon session");
+					_("Cannot remove password, no valid "
+					"logon session."));
 			} else {
 				purple_debug_error("keyring-wincred",
 					"Cannot remove password, error %lx\n",
 					error_code);
 				error = g_error_new(PURPLE_KEYRING_ERROR,
 					PURPLE_KEYRING_ERROR_BACKENDFAIL,
-					"Cannot remove password, error %lx",
+					_("Cannot remove password (error %lx)."),
 					error_code);
 			}



More information about the Commits mailing list