Make plugin-timer translatable

This commit is contained in:
TingPing 2014-06-21 22:11:37 -04:00
parent 7374637d34
commit 3342af4185
2 changed files with 10 additions and 7 deletions

View File

@ -10,6 +10,7 @@ src/common/inbound.c
src/common/notify.c src/common/notify.c
src/common/outbound.c src/common/outbound.c
src/common/plugin.c src/common/plugin.c
src/common/plugin-timer.c
src/common/server.c src/common/server.c
src/common/servlist.c src/common/servlist.c
src/common/textevents.h src/common/textevents.h

View File

@ -26,6 +26,8 @@
#define g_ascii_strcasecmp stricmp #define g_ascii_strcasecmp stricmp
#endif #endif
#define _(x) hexchat_gettext(ph,x)
static hexchat_plugin *ph; /* plugin handle */ static hexchat_plugin *ph; /* plugin handle */
static GSList *timer_list = NULL; static GSList *timer_list = NULL;
@ -68,13 +70,13 @@ timer_del_ref (int ref, int quiet)
{ {
timer_del (tim); timer_del (tim);
if (!quiet) if (!quiet)
hexchat_printf (ph, "Timer %d deleted.\n", ref); hexchat_printf (ph, _("Timer %d deleted.\n"), ref);
return; return;
} }
list = list->next; list = list->next;
} }
if (!quiet) if (!quiet)
hexchat_print (ph, "No such ref number found.\n"); hexchat_print (ph, _("No such ref number found.\n"));
} }
static int static int
@ -138,17 +140,17 @@ timer_showlist (void)
if (timer_list == NULL) if (timer_list == NULL)
{ {
hexchat_print (ph, "No timers installed.\n"); hexchat_print (ph, _("No timers installed.\n"));
hexchat_print (ph, HELP); hexchat_print (ph, _(HELP));
return; return;
} }
/* 00000 00000000 0000000 abc */ /* 00000 00000000 0000000 abc */
hexchat_print (ph, "\026 Ref# Seconds Repeat Command \026\n"); hexchat_print (ph, _("\026 Ref# Seconds Repeat Command \026\n"));
list = timer_list; list = timer_list;
while (list) while (list)
{ {
tim = list->data; tim = list->data;
hexchat_printf (ph, "%5d %8.1f %7d %s\n", tim->ref, tim->timeout, hexchat_printf (ph, _("%5d %8.1f %7d %s\n"), tim->ref, tim->timeout,
tim->repeat, tim->command); tim->repeat, tim->command);
list = list->next; list = list->next;
} }
@ -221,7 +223,7 @@ hexchat_plugin_init
*plugin_desc = "IrcII style /TIMER command"; *plugin_desc = "IrcII style /TIMER command";
*plugin_version = ""; *plugin_version = "";
hexchat_hook_command (ph, "TIMER", HEXCHAT_PRI_NORM, timer_cb, HELP, 0); hexchat_hook_command (ph, "TIMER", HEXCHAT_PRI_NORM, timer_cb, _(HELP), 0);
return 1; /* return 1 for success */ return 1; /* return 1 for success */
} }