changeset 30375:ab7e28b1b478

Gettextized the code and rephrased some of the messages slightly.
author ivan.komarov@soc.pidgin.im
date Thu, 01 Jul 2010 17:15:37 +0000
parents 48fe4720d795
children 50d472b3d752
files libpurple/protocols/oscar/visibility.c
diffstat 1 files changed, 21 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/oscar/visibility.c	Wed Jun 30 15:57:43 2010 +0000
+++ b/libpurple/protocols/oscar/visibility.c	Thu Jul 01 17:15:37 2010 +0000
@@ -20,6 +20,12 @@
 
 #include "visibility.h"
 
+/* 4 separate strings are needed in order to ease translators' job */
+#define APPEAR_ONLINE		N_("Appear Online")
+#define DONT_APPEAR_ONLINE	N_("Don't Appear Online")
+#define APPEAR_OFFLINE		N_("Appear Offline")
+#define DONT_APPEAR_OFFLINE	N_("Don't Appear Offline")
+
 static guint16
 get_buddy_list_type(OscarData *od, const char *bname)
 {
@@ -54,13 +60,14 @@
 	PurpleAccount *account = purple_connection_get_account(od->gc);
 	gboolean invisible = purple_account_is_status_active(account, OSCAR_STATUS_ID_INVISIBLE);
 	gboolean on_list = is_buddy_on_list(od, bname);
-	gchar *label;
-	PurpleMenuAction *result;
+	const gchar *label;
 
-	label = g_strdup_printf("%s %s", on_list ? "Don't Appear" : "Appear", invisible ? "Online" : "Offline");
-	result = purple_menu_action_new(label, PURPLE_CALLBACK(visibility_cb), NULL, NULL);
-	g_free(label);
-	return result;
+	if (invisible) {
+		label = on_list ? _(DONT_APPEAR_ONLINE) : _(APPEAR_ONLINE);
+	} else {
+		label = on_list ? _(DONT_APPEAR_OFFLINE) : _(APPEAR_OFFLINE);
+	}
+	return purple_menu_action_new(label, PURPLE_CALLBACK(visibility_cb), NULL, NULL);
 }
 
 static void
@@ -88,12 +95,12 @@
 	g_slist_free(buddies);
 
 	filtered_buddies = g_slist_reverse(filtered_buddies);
-	text = oscar_format_buddies(filtered_buddies, "you have no buddies on this list");
+	text = oscar_format_buddies(filtered_buddies, _("you have no buddies on this list"));
 	g_slist_free(filtered_buddies);
 
-	secondary = g_strdup_printf("You can add a buddy to this list "
+	secondary = g_strdup_printf(_("You can add a buddy to this list "
 					"by right-clicking on them and "
-					"selecting \"%s\"", menu_action_name);
+					"selecting \"%s\""), menu_action_name);
 	purple_notify_formatted(gc, NULL, list_description, secondary, text, NULL, NULL);
 	g_free(secondary);
 	g_free(text);
@@ -102,13 +109,14 @@
 void
 oscar_show_visible_list(PurplePluginAction *action)
 {
-	show_private_list(action, AIM_SSI_TYPE_PERMIT, "These buddies will always see "
-							"your status, even when you switch "
-							"to \"Invisible\"", "Appear Online");
+	show_private_list(action, AIM_SSI_TYPE_PERMIT, _("These buddies will see "
+							"your status when you switch "
+							"to \"Invisible\""),
+							_(APPEAR_ONLINE));
 }
 
 void
 oscar_show_invisible_list(PurplePluginAction *action)
 {
-	show_private_list(action, AIM_SSI_TYPE_DENY, "These buddies will always see you as offline", "Appear Offline");
+	show_private_list(action, AIM_SSI_TYPE_DENY, _("These buddies will always see you as offline"), _(APPEAR_OFFLINE));
 }
\ No newline at end of file