pidgin/purple-plugin-pack

This should be i18n support for timelog
org.guifications.plugins
2007-10-22, rekkanoryo
0ea278205929
Parents ade03f2afb33
Children 2b561dd84cda
This should be i18n support for timelog
--- a/po/POTFILES.in Mon Oct 22 04:06:49 2007 -0400
+++ b/po/POTFILES.in Mon Oct 22 04:37:51 2007 -0400
@@ -63,5 +63,9 @@
stocker/stocker_prefs.c
switchspell/switchspell.c
talkfilters/talkfilters.c
+timelog/log-widget.c
+timelog/range-widget.c
+timelog/timelog.c
+timelog/timelog.h
xchat-chats/xchat-chats.c
xchat-chats/xchat-chats.c
--- a/timelog/log-widget.c Mon Oct 22 04:06:49 2007 -0400
+++ b/timelog/log-widget.c Mon Oct 22 04:37:51 2007 -0400
@@ -221,9 +221,9 @@
strftime(time, sizeof(time), "%c", localtime(&log->time));
if (log->type == PURPLE_LOG_CHAT)
- title = g_strdup_printf("Conversation in %s on %s", log->name, time);
+ title = g_strdup_printf(_("Conversation in %s on %s"), log->name, time);
else
- title = g_strdup_printf("Conversation with %s on %s", log->name, time);
+ title = g_strdup_printf(_("Conversation with %s on %s"), log->name, time);
title_utf8 = purple_utf8_try_convert(title);
g_free(title);
@@ -285,7 +285,7 @@
if (logs == NULL) {
/* No logs were found. */
- purple_notify_info(NULL, TIMELOG_TITLE, "No logs were found", NULL);
+ purple_notify_info(NULL, TIMELOG_TITLE, _("No logs were found"), NULL);
return;
}
--- a/timelog/range-widget.c Mon Oct 22 04:06:49 2007 -0400
+++ b/timelog/range-widget.c Mon Oct 22 04:37:51 2007 -0400
@@ -223,11 +223,11 @@
gtk_widget_show(hbox46);
gtk_box_pack_start(GTK_BOX(vbox7), hbox46, FALSE, FALSE, 5);
- label43 = gtk_label_new("Start Time");
+ label43 = gtk_label_new(_("Start Time"));
gtk_widget_show(label43);
gtk_box_pack_start(GTK_BOX(hbox46), label43, TRUE, TRUE, 0);
- label44 = gtk_label_new("End Time");
+ label44 = gtk_label_new(_("End Time"));
gtk_widget_show(label44);
gtk_box_pack_start(GTK_BOX(hbox46), label44, TRUE, TRUE, 0);
@@ -327,7 +327,7 @@
gtk_widget_show(image49);
gtk_box_pack_start(GTK_BOX(hbox341), image49, FALSE, FALSE, 0);
- label97 = gtk_label_new_with_mnemonic("Select Time Range");
+ label97 = gtk_label_new_with_mnemonic(_("Select Time Range"));
gtk_widget_show(label97);
gtk_box_pack_start(GTK_BOX(hbox341), label97, FALSE, FALSE, 0);
--- a/timelog/timelog.c Mon Oct 22 04:06:49 2007 -0400
+++ b/timelog/timelog.c Mon Oct 22 04:37:51 2007 -0400
@@ -125,9 +125,9 @@
purple_request_fields_add_group(request, group);
purple_request_fields(action->plugin, TIMELOG_TITLE,
- "Select account to view logs for:", NULL, request,
- "Select Account", G_CALLBACK(cb_select_time),
- "Cancel", NULL, NULL, NULL, NULL, NULL);
+ _("Select account to view logs for:"), NULL, request,
+ _("Select Account"), G_CALLBACK(cb_select_time),
+ _("Cancel"), NULL, NULL, NULL, NULL, NULL);
}
static GList *
@@ -136,7 +136,7 @@
GList *l = NULL;
PurplePluginAction *act = NULL;
- act = purple_plugin_action_new("Select Account/Time", cb_select_account);
+ act = purple_plugin_action_new(_("Select Account/Time"), cb_select_account);
l = g_list_append(l, act);
return l;
@@ -163,14 +163,14 @@
PIDGIN_PLUGIN_TYPE, /**< ui_req */
0, /**< flags */
NULL, /**< deps */
- PURPLE_PRIORITY_DEFAULT, /**< priority */
+ PURPLE_PRIORITY_DEFAULT, /**< priority */
TIMELOG_PLUGIN_ID, /**< id */
- TIMELOG_TITLE, /**< name */
+ NULL, /**< name */
PP_VERSION, /**< version */
/** summary */
- "Allows the viewing of Pidgin logs within a specific time range",
+ N_("Allows the viewing of Pidgin logs within a specific time range"),
/** desc */
- "Allows the viewing of Pidgin logs within a specific time range",
+ N_("Allows the viewing of Pidgin logs within a specific time range"),
"Jon Oberheide <jon@oberheide.org>", /**< author */
"http://jon.oberheide.org/projects/gaim-timelog/",
/**< homepage */
@@ -186,6 +186,14 @@
static void
init_plugin(PurplePlugin *plugin)
{
+#ifdef ENABLE_NLS
+ bindtextdomain(GETTEXT_PACKAGE, PP_LOCALEDIR);
+ bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
+#endif
+
+ info.name = TIMELOG_TITLE;
+ info.summary = _(info.summary);
+ info.description = _(info.description);
}
PURPLE_INIT_PLUGIN(timelog, init_plugin, info)
--- a/timelog/timelog.h Mon Oct 22 04:06:49 2007 -0400
+++ b/timelog/timelog.h Mon Oct 22 04:37:51 2007 -0400
@@ -25,7 +25,7 @@
#define _TIMELOG_H
#define TIMELOG_PLUGIN_ID "gtk-binaryjono-timelog"
-#define TIMELOG_TITLE "TimeLog"
+#define TIMELOG_TITLE _("TimeLog")
#define tl_debug(fmt, ...) purple_debug(PURPLE_DEBUG_INFO, TIMELOG_TITLE, \
fmt, ## __VA_ARGS__);