org.guifications.plugins: 6f1df6cc4057b31b342a1c3d13c8470c536bdb77

rekkanoryo at guifications.org rekkanoryo at guifications.org
Sun Oct 21 23:45:07 CDT 2007


-----------------------------------------------------------------
Revision: 6f1df6cc4057b31b342a1c3d13c8470c536bdb77
Ancestor: 18c7efadabc46dd5e438657cdea11d34e298c17f
Author: rekkanoryo at guifications.org
Date: 2007-10-22T04:37:51
Branch: org.guifications.plugins

Modified files:
        po/POTFILES.in timelog/log-widget.c timelog/range-widget.c
        timelog/timelog.c timelog/timelog.h

ChangeLog: 

This should be i18n support for timelog

-----------------------------------------------------------------
This revision's diffstat output:
 po/POTFILES.in         |    4 ++++
 timelog/log-widget.c   |    6 +++---
 timelog/range-widget.c |    6 +++---
 timelog/timelog.c      |   24 ++++++++++++++++--------
 timelog/timelog.h      |    2 +-
 5 files changed, 27 insertions(+), 15 deletions(-)
-------------- next part --------------
============================================================
--- po/POTFILES.in	1af1c8080615af5e455247d1b7965fd4e9080f43
+++ po/POTFILES.in	9e282a7c8138f2d362c7eadbbcd5bcedcb657ccc
@@ -63,5 +63,9 @@ talkfilters/talkfilters.c
 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
============================================================
--- timelog/log-widget.c	a519042b5b2efe9b136e5f9c5330e9cd33155f10
+++ timelog/log-widget.c	e059acf53ddfdb8eea5844b5d5dfbaa4a942d29c
@@ -221,9 +221,9 @@ log_select_cb(GtkTreeSelection *sel, Pid
 		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 @@ log_widget_display_logs(GList *logs)
 
 	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;
 	}
 
============================================================
--- timelog/range-widget.c	14cdc45510ffa6adb3f728ab909bb218e006b5eb
+++ timelog/range-widget.c	d74c0b13d974d08ad1effe7e7b08f2fa444a2cf3
@@ -223,11 +223,11 @@ range_widget_create()
 	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 @@ range_widget_create()
 	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);
 
============================================================
--- timelog/timelog.c	3c28059681f56f5e4a070fefb30dab3f904ffdc5
+++ timelog/timelog.c	317a5ef2f7cdff1bd586f5fcb917c544600e5c43
@@ -125,9 +125,9 @@ cb_select_account(PurplePluginAction *ac
 	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 @@ actions(PurplePlugin *plugin, gpointer c
 	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 @@ static PurplePluginInfo info =
 	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 at oberheide.org>",		/**< author	*/
 	"http://jon.oberheide.org/projects/gaim-timelog/",
 							/**< homepage	*/
@@ -186,6 +186,14 @@ init_plugin(PurplePlugin *plugin)
 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)
============================================================
--- timelog/timelog.h	beff3f9c7142e797c5d98010eca7d4db6d23203c
+++ timelog/timelog.h	8165b22cf8e87cacaaff4b7c9e39312204931ece
@@ -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__);


More information about the Plugins-commits mailing list