summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Komarov <ivan.komarov@pidgin.im>2010-07-01 17:15:37 +0000
committerIvan Komarov <ivan.komarov@pidgin.im>2010-07-01 17:15:37 +0000
commit6a4b47f01b0f5ad0bef6558ce0de79746ce92bc6 (patch)
tree26f9893dceedd51eebc524aec540c997521d68c2
parent9deb0a1b80eb7c122251fb784399b98609bef1f9 (diff)
downloadpidgin-6a4b47f01b0f5ad0bef6558ce0de79746ce92bc6.tar.gz
Gettextized the code and rephrased some of the messages slightly.
-rw-r--r--libpurple/protocols/oscar/visibility.c34
1 files changed, 21 insertions, 13 deletions
diff --git a/libpurple/protocols/oscar/visibility.c b/libpurple/protocols/oscar/visibility.c
index 6983548d2c..4b5fe9167c 100644
--- a/libpurple/protocols/oscar/visibility.c
+++ b/libpurple/protocols/oscar/visibility.c
@@ -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 @@ create_visibility_menu_item(OscarData *od, const char *bname)
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 @@ show_private_list(PurplePluginAction *action, guint16 list_type, const gchar *li
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 @@ show_private_list(PurplePluginAction *action, guint16 list_type, const gchar *li
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