summaryrefslogtreecommitdiff
path: root/src/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/alias/alias.c39
-rw-r--r--src/plugins/demo/demo.c23
-rw-r--r--src/plugins/fifo/fifo.c32
-rw-r--r--src/plugins/irc/irc-channel.c4
-rw-r--r--src/plugins/irc/irc-command.c268
-rw-r--r--src/plugins/irc/irc-config.c34
-rw-r--r--src/plugins/irc/irc-display.c4
-rw-r--r--src/plugins/irc/irc-protocol.c396
-rw-r--r--src/plugins/irc/irc-server.c172
-rw-r--r--src/plugins/logger/logger.c4
-rw-r--r--src/plugins/plugin-api.c6
-rw-r--r--src/plugins/plugin.c26
12 files changed, 517 insertions, 491 deletions
diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c
index d8d9f8174..44091d1ae 100644
--- a/src/plugins/alias/alias.c
+++ b/src/plugins/alias/alias.c
@@ -191,9 +191,9 @@ alias_cb (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
if (ptr_alias->running)
{
weechat_printf (NULL,
- _("%sAlias: error, circular reference when calling "
- "alias \"/%s\""),
- weechat_prefix ("error"),
+ _("%s%s: error, circular reference when calling "
+ "alias \"%s\""),
+ weechat_prefix ("error"), "Alias",
ptr_alias->name);
return WEECHAT_RC_ERROR;
}
@@ -349,9 +349,9 @@ alias_get_final_command (struct t_alias *alias)
if (alias->running)
{
weechat_printf (NULL,
- _("%sAlias: error, circular reference when calling "
- "alias \"/%s\""),
- weechat_prefix ("error"),
+ _("%s%s: error, circular reference when calling "
+ "alias \"%s\""),
+ weechat_prefix ("error"), "Alias",
alias->name);
return NULL;
}
@@ -431,8 +431,8 @@ alias_config_read_line (struct t_config_file *config_file, char *option_name,
if (!alias_new (option_name, value))
{
weechat_printf (NULL,
- "%sAlias: error creating alias \"%s\" => \"%s\"",
- weechat_prefix ("error"),
+ "%s%s: error creating alias \"%s\" => \"%s\"",
+ weechat_prefix ("error"), "Alias",
option_name, value);
}
}
@@ -551,14 +551,13 @@ alias_config_reload_signal_cb (void *data, char *signal, void *signal_data)
if (weechat_config_reload (alias_config_file) == 0)
{
weechat_printf (NULL,
- _("%sAlias: configuration file reloaded"),
- weechat_prefix ("info"));
+ _("%s%s: configuration file reloaded"),
+ weechat_prefix ("info"), "Alias");
return WEECHAT_RC_OK;
}
weechat_printf (NULL,
- _("%sAlias: failed to reload alias configuration "
- "file"),
- weechat_prefix ("error"));
+ _("%s%s: failed to reload configuration file"),
+ weechat_prefix ("error"), "Alias");
return WEECHAT_RC_ERROR;
}
@@ -596,9 +595,9 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
if (!alias_new (alias_name, argv_eol[2]))
{
weechat_printf (NULL,
- _("%sAlias: error creating alias \"%s\" "
- "=> \"%\""),
- weechat_prefix ("error"),
+ _("%s%s: error creating alias \"%s\" "
+ "=> \"%s\""),
+ weechat_prefix ("error"), "Alias",
alias_name, argv_eol[2]);
return WEECHAT_RC_ERROR;
}
@@ -646,9 +645,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
}
}
else
- weechat_printf (NULL,
- _("%sNo alias defined."),
- weechat_prefix ("info"));
+ weechat_printf (NULL, _("No alias defined"));
}
return 0;
}
@@ -726,8 +723,8 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
if (!alias_config_init ())
{
weechat_printf (NULL,
- "%sAlias: error creating configuration file \"%s\"",
- weechat_prefix("error"),
+ "%s%s: error creating configuration file \"%s\"",
+ weechat_prefix("error"), "Alias",
ALIAS_CONFIG_FILENAME);
return WEECHAT_RC_ERROR;
}
diff --git a/src/plugins/demo/demo.c b/src/plugins/demo/demo.c
index 130585c18..d7fa110ac 100644
--- a/src/plugins/demo/demo.c
+++ b/src/plugins/demo/demo.c
@@ -96,7 +96,7 @@ demo_infobar_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
weechat_infobar_printf (10, NULL,
(argc > 1) ?
- argv_eol[1] : _("test infobar"));
+ argv_eol[1] : _("test message in infobar"));
return WEECHAT_RC_OK;
}
@@ -238,9 +238,9 @@ demo_infolist_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
}
weechat_printf (NULL,
- _("%sDemo: missing argument for /%s command "
+ _("%s%s: missing argument for \"%s\" command "
"(try /help %s)"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "Demo",
"demo_infolist", "demo_infolist");
return WEECHAT_RC_OK;
@@ -266,9 +266,9 @@ demo_info_command_cb (void *data, struct t_gui_buffer *buffer, int argc,
weechat_info_get (argv[1]));
else
weechat_printf (NULL,
- _("%sDemo: missing argument for /%s command "
+ _("%s%s: missing argument for \"%s\" command "
"(try /help %s)"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "Demo",
"demo_info", "demo_info");
return WEECHAT_RC_OK;
@@ -301,17 +301,16 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
weechat_plugin = plugin;
weechat_hook_command ("demo_printf",
- _("demo command: print some messages"),
+ _("print some messages on current ubffer"),
_("[text]"),
- _("text: write some text on current buffer"),
+ _("text: write this text"),
"",
&demo_printf_command_cb, NULL);
weechat_hook_command ("demo_infobar",
- _("demo command: print a message in infobar for 10 "
- "seconds"),
+ _("print a message in infobar for 10 seconds"),
_("[text]"),
- _("text: write this text on infobar"),
+ _("text: write this text"),
"",
&demo_infobar_command_cb, NULL);
@@ -323,7 +322,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
&demo_buffer_command_cb, NULL);
weechat_hook_command ("demo_infolist",
- _("demo command: get and display list"),
+ _("get and display an infolist"),
_("infolist"),
_("infolist: infolist to display (values: buffer, "
"buffer_lines)"),
@@ -331,7 +330,7 @@ weechat_plugin_init (struct t_weechat_plugin *plugin)
&demo_infolist_command_cb, NULL);
weechat_hook_command ("demo_info",
- _("demo command: get and display info"),
+ _("get and display an info"),
_("info"),
_("info: info to display (values: version, "
"weechat_dir, weechat_libdir, weechat_sharedir, "
diff --git a/src/plugins/fifo/fifo.c b/src/plugins/fifo/fifo.c
index d894c5c89..c1dd8a5fc 100644
--- a/src/plugins/fifo/fifo.c
+++ b/src/plugins/fifo/fifo.c
@@ -96,22 +96,22 @@ fifo_create ()
O_RDONLY | O_NONBLOCK)) != -1)
{
weechat_printf (NULL,
- _("%sFifo: pipe is open\n"),
- weechat_prefix ("info"));
+ _("%s%s: pipe open"),
+ weechat_prefix ("info"), "Fifo"),
rc = 1;
}
else
weechat_printf (NULL,
- _("%sFifo: unable to open pipe (%s) for "
+ _("%s%s: unable to open pipe (%s) for "
"reading"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "Fifo",
fifo_filename);
}
else
weechat_printf (NULL,
- _("%sFifo: unable to create pipe for remote "
+ _("%s%s: unable to create pipe for remote "
"control (%s)"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "Fifo",
fifo_filename);
}
}
@@ -152,8 +152,8 @@ fifo_remove ()
}
weechat_printf (NULL,
- _("%sFifo: pipe is closed"),
- weechat_prefix ("info"));
+ _("%s%s: pipe closed"),
+ weechat_prefix ("info"), "Fifo");
}
/*
@@ -184,8 +184,8 @@ fifo_exec (char *text)
if (!pos_msg)
{
weechat_printf (NULL,
- _("%sFifo error: invalid text received on pipe"),
- weechat_prefix ("error"));
+ _("%s%s: error, invalid text received on pipe"),
+ weechat_prefix ("error"), "Fifo");
return;
}
pos_msg[0] = '\0';
@@ -215,8 +215,8 @@ fifo_exec (char *text)
if (!ptr_buffer)
{
weechat_printf (NULL,
- _("%sFifo error: buffer not found for pipe data"),
- weechat_prefix ("error"));
+ _("%s%s: error, buffer not found for pipe data"),
+ weechat_prefix ("error"), "Fifo");
return;
}
@@ -294,8 +294,8 @@ fifo_read ()
if (num_read < 0)
{
weechat_printf (NULL,
- _("%sFifo: error reading pipe, closing it"),
- weechat_prefix ("error"));
+ _("%s%s: error reading pipe, closing it"),
+ weechat_prefix ("error"), "Fifo");
fifo_remove ();
}
else
@@ -306,8 +306,8 @@ fifo_read ()
if (fifo_fd < 0)
{
weechat_printf (NULL,
- _("%sFifo: error opening file, closing it"),
- weechat_prefix ("error"));
+ _("%s%s: error opening file, closing it"),
+ weechat_prefix ("error"), "Fifo");
fifo_remove ();
}
else
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c
index 39a9b8ff7..635fc0df4 100644
--- a/src/plugins/irc/irc-channel.c
+++ b/src/plugins/irc/irc-channel.c
@@ -51,8 +51,8 @@ irc_channel_new (struct t_irc_server *server, int channel_type,
if ((new_channel = (struct t_irc_channel *)malloc (sizeof (struct t_irc_channel))) == NULL)
{
weechat_printf (NULL,
- _("%sirc: cannot allocate new channel"),
- weechat_prefix ("error"));
+ _("%s%s: cannot allocate new channel"),
+ weechat_prefix ("error"), "irc");
return NULL;
}
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 8ee43daff..aac4448c2 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -228,9 +228,9 @@ irc_command_amsg (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: cannot find nick for "
+ _("%s%s: cannot find nick for "
"sending message"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
}
}
@@ -304,8 +304,8 @@ irc_command_away_server (struct t_irc_server *server, char *arguments)
string = (char *)irc_color_decode ((unsigned char *)arguments,
1, 0);
weechat_printf (server->buffer,
- _("%sirc: future away on %s%s%s: %s"),
- weechat_prefix ("info"),
+ _("%s%s: future away on %s%s%s: %s"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
server->name,
IRC_COLOR_CHAT,
@@ -362,8 +362,8 @@ irc_command_away_server (struct t_irc_server *server, char *arguments)
/* server not connected, remove away message but do not send
anything */
weechat_printf (server->buffer,
- _("%sirc: future away on %s%s%s removed"),
- weechat_prefix ("info"),
+ _("%s%s: future away on %s%s%s removed"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
server->name,
IRC_COLOR_CHAT);
@@ -445,9 +445,9 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "ban");
+ weechat_prefix ("error"), "irc", "ban");
return WEECHAT_RC_ERROR;
}
}
@@ -465,9 +465,9 @@ irc_command_ban (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"ban");
return WEECHAT_RC_ERROR;
}
@@ -491,18 +491,18 @@ irc_command_connect_one_server (struct t_irc_server *server, int no_join)
if (server->is_connected)
{
weechat_printf (NULL,
- _("%sirc: already connected to server "
+ _("%s%s: already connected to server "
"\"%s\"!"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
server->name);
return 0;
}
if (server->child_pid > 0)
{
weechat_printf (NULL,
- _("%sirc: currently connecting to server "
+ _("%s%s: currently connecting to server "
"\"%s\"!"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
server->name);
return 0;
}
@@ -559,9 +559,9 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for \"%s\" "
+ _("%s%s: missing argument for \"%s\" "
"option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-port");
return WEECHAT_RC_ERROR;
}
@@ -630,10 +630,10 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
if (ptr_server)
{
weechat_printf (NULL,
- _("%sirc: server %s%s%s created "
+ _("%s%s: server %s%s%s created "
"(temporary server, "
"NOT SAVED!)"),
- weechat_prefix ("info"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
server_tmp.name,
IRC_COLOR_CHAT);
@@ -643,9 +643,9 @@ irc_command_connect (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (NULL,
- _("%sirc: unable to create server "
+ _("%s%s: unable to create server "
"\"%s\""),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[i]);
}
}
@@ -801,9 +801,9 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can not be executed "
+ _("%s%s: \"%s\" command can not be executed "
"on a server buffer"),
- weechat_prefix ("error"), "cycle");
+ weechat_prefix ("error"), "irc", "cycle");
return WEECHAT_RC_ERROR;
}
@@ -821,9 +821,9 @@ irc_command_cycle (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can not be executed on "
+ _("%s%s: \"%s\" command can not be executed on "
"a server buffer"),
- weechat_prefix ("error"), "part");
+ weechat_prefix ("error"), "irc", "part");
return WEECHAT_RC_ERROR;
}
@@ -911,8 +911,8 @@ irc_command_dcc (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: wrong arguments for \"%s\" command"),
- weechat_prefix ("error"), "dcc");
+ _("%s%s: wrong arguments for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "dcc");
return WEECHAT_RC_ERROR;
}
}
@@ -953,9 +953,9 @@ irc_command_dehalfop (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be executed in "
+ _("%s%s: \"%s\" command can only be executed in "
"a channel buffer"),
- weechat_prefix ("error"), "dehalfop");
+ weechat_prefix ("error"), "irc", "dehalfop");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
@@ -990,9 +990,9 @@ irc_command_deop (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be executed in "
+ _("%s%s: \"%s\" command can only be executed in "
"a channel buffer"),
- weechat_prefix ("error"), "deop");
+ weechat_prefix ("error"), "irc", "deop");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
@@ -1027,9 +1027,9 @@ irc_command_devoice (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "devoice");
+ weechat_prefix ("error"), "irc", "devoice");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
@@ -1108,14 +1108,15 @@ irc_command_disconnect_one_server (struct t_irc_server *server)
&& (server->reconnect_start == 0))
{
weechat_printf (server->buffer,
- _("%sirc: not connected to server \"%s\"!"),
- weechat_prefix ("error"), server->name);
+ _("%s%s: not connected to server \"%s\"!"),
+ weechat_prefix ("error"), "irc", server->name);
return 0;
}
if (server->reconnect_start > 0)
{
weechat_printf (server->buffer,
- _("irc: auto-reconnection is cancelled"));
+ _("%s%s: auto-reconnection is cancelled"),
+ weechat_prefix ("info"), "irc");
}
irc_command_quit_server (server, NULL);
irc_server_disconnect (server, 0);
@@ -1173,8 +1174,8 @@ irc_command_disconnect (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found"),
- weechat_prefix ("error"), argv[i]);
+ _("%s%s: server \"%s\" not found"),
+ weechat_prefix ("error"), "irc", argv[i]);
disconnect_ok = 0;
}
}
@@ -1216,9 +1217,9 @@ irc_command_halfop (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "halfop");
+ weechat_prefix ("error"), "irc", "halfop");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
@@ -1273,9 +1274,9 @@ irc_command_invite (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "invite");
+ weechat_prefix ("error"), "irc", "invite");
return WEECHAT_RC_ERROR;
}
@@ -1372,9 +1373,9 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc,
if (argc < 3)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: wrong arguments for \"%s\" "
+ _("%s%s: wrong arguments for \"%s\" "
"command"),
- weechat_prefix ("error"), "kick");
+ weechat_prefix ("error"), "irc", "kick");
return WEECHAT_RC_ERROR;
}
pos_channel = argv[1];
@@ -1392,9 +1393,9 @@ irc_command_kick (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "kick");
+ weechat_prefix ("error"), "irc", "kick");
return WEECHAT_RC_ERROR;
}
}
@@ -1438,9 +1439,9 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
if (argc < 3)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: wrong arguments for \"%s\" "
+ _("%s%s: wrong arguments for \"%s\" "
"command"),
- weechat_prefix ("error"), "kickban");
+ weechat_prefix ("error"), "irc", "kickban");
return WEECHAT_RC_ERROR;
}
pos_channel = argv[1];
@@ -1458,9 +1459,9 @@ irc_command_kickban (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "kickban");
+ weechat_prefix ("error"), "irc", "kickban");
return WEECHAT_RC_ERROR;
}
}
@@ -1573,9 +1574,9 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
regerror (ret, ptr_server->cmd_list_regexp,
buf, sizeof(buf));
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" is not a valid regular "
+ _("%s%s: \"%s\" is not a valid regular "
"expression (%s)"),
- weechat_prefix ("error"), argv_eol, buf);
+ weechat_prefix ("error"), "irc", argv_eol, buf);
return WEECHAT_RC_ERROR;
}
else
@@ -1584,9 +1585,9 @@ irc_command_list (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: not enough memory for regular "
+ _("%s%s: not enough memory for regular "
"expression"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
return WEECHAT_RC_ERROR;
}
}
@@ -1641,9 +1642,9 @@ irc_command_me (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can not be executed "
+ _("%s%s: \"%s\" command can not be executed "
"on a server buffer"),
- weechat_prefix ("error"), "me");
+ weechat_prefix ("error"), "irc", "me");
return WEECHAT_RC_ERROR;
}
irc_command_me_channel (ptr_server, ptr_channel, argv_eol[1]);
@@ -1753,10 +1754,10 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
&& (ptr_channel->type != IRC_CHANNEL_TYPE_PRIVATE)))
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel or private "
"buffer"),
- weechat_prefix ("error"), "msg *");
+ weechat_prefix ("error"), "irc", "msg *");
}
if (ptr_channel->type == IRC_CHANNEL_TYPE_CHANNEL)
ptr_nick = irc_nick_search (ptr_channel, ptr_server->nick);
@@ -1803,10 +1804,10 @@ irc_command_msg (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: nick \"%s\" not "
+ _("%s%s: nick \"%s\" not "
"found for \"%s\" command"),
weechat_prefix ("error"),
- ptr_server->nick,
+ "irc", ptr_server->nick,
"msg");
}
}
@@ -1917,9 +1918,9 @@ irc_command_names (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "names");
+ weechat_prefix ("error"), "irc", "names");
return WEECHAT_RC_ERROR;
}
}
@@ -1976,8 +1977,8 @@ irc_command_nick (void *data, struct t_gui_buffer *buffer, int argc,
if (weechat_strcasecmp (argv[1], "-all") != 0)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: wrong arguments for \"%s\" command"),
- weechat_prefix ("error"), "nick");
+ _("%s%s: wrong arguments for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "nick");
return WEECHAT_RC_ERROR;
}
for (ptr_server = irc_servers; ptr_server;
@@ -2070,9 +2071,9 @@ irc_command_op (void *data, struct t_gui_buffer *buffer, int argc, char **argv,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "op");
+ weechat_prefix ("error"), "irc", "op");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
@@ -2133,10 +2134,10 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel or "
"private buffer"),
- weechat_prefix ("error"), "part");
+ weechat_prefix ("error"), "irc", "part");
return WEECHAT_RC_ERROR;
}
channel_name = ptr_channel->name;
@@ -2148,10 +2149,10 @@ irc_command_part (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel or private "
"buffer"),
- weechat_prefix ("error"), "part");
+ weechat_prefix ("error"), "irc", "part");
return WEECHAT_RC_ERROR;
}
if (!ptr_channel->nicks)
@@ -2272,9 +2273,9 @@ irc_command_query (void *data, struct t_gui_buffer *buffer, int argc,
if (!ptr_channel)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: cannot create new private "
+ _("%s%s: cannot create new private "
"buffer \"%s\""),
- weechat_prefix ("error"), argv[1]);
+ weechat_prefix ("error"), "irc", argv[1]);
return WEECHAT_RC_ERROR;
}
}
@@ -2346,8 +2347,8 @@ irc_command_reconnect_one_server (struct t_irc_server *server, int no_join)
if ((!server->is_connected) && (server->child_pid == 0))
{
weechat_printf (server->buffer,
- _("%sirc: not connected to server \"%s\"!"),
- weechat_prefix ("error"), server->name);
+ _("%s%s: not connected to server \"%s\"!"),
+ weechat_prefix ("error"), "irc", server->name);
return 0;
}
irc_command_quit_server (server, NULL);
@@ -2421,8 +2422,8 @@ irc_command_reconnect (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found"),
- weechat_prefix ("error"), argv[i]);
+ _("%s%s: server \"%s\" not found"),
+ weechat_prefix ("error"), "irc", argv[i]);
reconnect_ok = 0;
}
}
@@ -2557,7 +2558,7 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
}
if (!one_server_found)
weechat_printf (NULL,
- _("No server with '%s' found"),
+ _("No server found with \"%s\""),
server_name);
}
}
@@ -2572,9 +2573,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (irc_server_search (argv[2]))
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" already exists, "
+ _("%s%s: server \"%s\" already exists, "
"can't create it!"),
- weechat_prefix ("error"), argv[2]);
+ weechat_prefix ("error"), "irc", argv[2]);
return WEECHAT_RC_ERROR;
}
@@ -2605,9 +2606,10 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"), "-port");
+ weechat_prefix ("error"), "irc",
+ "-port");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
}
@@ -2621,9 +2623,10 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"), "-pwd");
+ weechat_prefix ("error"), "irc",
+ "-pwd");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
}
@@ -2634,9 +2637,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i >= (argc - 3))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-nicks");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
@@ -2650,9 +2653,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-username");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
@@ -2664,9 +2667,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-realname");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
@@ -2678,9 +2681,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-command");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
@@ -2692,9 +2695,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (i == (argc - 1))
{
weechat_printf (NULL,
- _("%sirc: missing argument for "
+ _("%s%s: missing argument for "
"\"%s\" option"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
"-autojoin");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
@@ -2729,8 +2732,8 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (new_server)
{
weechat_printf (NULL,
- _("%sirc: server %s%s%s created"),
- weechat_prefix ("info"),
+ _("%s%s: server %s%s%s created"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
server_tmp.name,
IRC_COLOR_CHAT);
@@ -2738,8 +2741,8 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (NULL,
- _("%sirc: unable to create server"),
- weechat_prefix ("error"));
+ _("%s%s: unable to create server"),
+ weechat_prefix ("error"), "irc");
irc_server_free_data (&server_tmp);
return WEECHAT_RC_ERROR;
}
@@ -2761,9 +2764,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (!server_found)
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found for "
+ _("%s%s: server \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[2], "server copy");
return WEECHAT_RC_ERROR;
}
@@ -2772,9 +2775,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (irc_server_search (argv[3]))
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" already exists for "
+ _("%s%s: server \"%s\" already exists for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[3], "server copy");
return WEECHAT_RC_ERROR;
}
@@ -2784,8 +2787,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (new_server)
{
weechat_printf (NULL,
- _("%sirc: Server %s%s%s has been copied to "
+ _("%s%s: Server %s%s%s has been copied to "
"%s%s"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
argv[2],
IRC_COLOR_CHAT,
@@ -2809,9 +2813,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (!server_found)
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found for "
+ _("%s%s: server \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[2], "server rename");
return WEECHAT_RC_ERROR;
}
@@ -2820,9 +2824,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (irc_server_search (argv[3]))
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" already exists for "
+ _("%s%s: server \"%s\" already exists for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[3], "server rename");
return WEECHAT_RC_ERROR;
}
@@ -2831,9 +2835,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (irc_server_rename (server_found, argv[3]))
{
weechat_printf (NULL,
- _("%sirc: server %s%s%s has been renamed to "
+ _("%s%s: server %s%s%s has been renamed to "
"%s%s"),
- weechat_prefix ("info"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
argv[2],
IRC_COLOR_CHAT,
@@ -2857,9 +2861,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (!server_found)
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found for "
+ _("%s%s: server \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[2], "server keep");
return WEECHAT_RC_ERROR;
}
@@ -2868,9 +2872,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (!server_found->temp_server)
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" is not a temporary "
+ _("%s%s: server \"%s\" is not a temporary "
"server"),
- weechat_prefix ("error"), argv[2]);
+ weechat_prefix ("error"), "irc", argv[2]);
return WEECHAT_RC_ERROR;
}
@@ -2878,9 +2882,9 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
server_found->temp_server = 0;
weechat_printf (NULL,
- _("%sirc: server %s%s%s is not temporary any "
+ _("%s%s: server %s%s%s is not temporary any "
"more"),
- weechat_prefix ("info"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
argv[2],
IRC_COLOR_CHAT);
@@ -2899,19 +2903,20 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
if (!server_found)
{
weechat_printf (NULL,
- _("%sirc: server \"%s\" not found for "
+ _("%s%s: server \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
argv[2], "server del");
return WEECHAT_RC_ERROR;
}
if (server_found->is_connected)
{
weechat_printf (NULL,
- _("%sirc: you can not delete server \"%s\" "
+ _("%s%s: you can not delete server \"%s\" "
"because you are connected to. "
"Try \"/disconnect %s\" before."),
- weechat_prefix ("error"), argv[2], argv[2]);
+ weechat_prefix ("error"), "irc",
+ argv[2], argv[2]);
return WEECHAT_RC_ERROR;
}
@@ -2933,8 +2938,8 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
irc_server_free (server_found);
weechat_printf (NULL,
- _("%sirc: Server %s%s%s has been deleted"),
- weechat_prefix ("info"),
+ _("%s%s: Server %s%s%s has been deleted"),
+ weechat_prefix ("info"), "irc",
IRC_COLOR_CHAT_SERVER,
(server_name) ? server_name : "???",
IRC_COLOR_CHAT);
@@ -2953,16 +2958,17 @@ irc_command_server (void *data, struct t_gui_buffer *buffer, int argc,
irc_server_outqueue_free_all (ptr_server);
}
weechat_printf (NULL,
- _("irc: messages outqueue DELETED for all "
+ _("%s%s: messages outqueue DELETED for all "
"servers. Some messages from you or "
- "WeeChat may have been lost!"));
+ "WeeChat may have been lost!"),
+ weechat_prefix ("info"), "irc");
return WEECHAT_RC_OK;
}
else
{
weechat_printf (NULL,
- _("%sirc: unknown option for \"%s\" command"),
- weechat_prefix ("error"), "server");
+ _("%s%s: unknown option for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "server");
return WEECHAT_RC_ERROR;
}
}
@@ -3192,9 +3198,9 @@ irc_command_topic (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "topic");
+ weechat_prefix ("error"), "irc", "topic");
return WEECHAT_RC_ERROR;
}
}
@@ -3279,9 +3285,9 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "unban");
+ weechat_prefix ("error"), "irc", "unban");
return WEECHAT_RC_ERROR;
}
}
@@ -3297,8 +3303,8 @@ irc_command_unban (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: wrong argument count for \"%s\" command"),
- weechat_prefix ("error"), "unban");
+ _("%s%s: wrong argument count for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "unban");
return WEECHAT_RC_ERROR;
}
@@ -3416,9 +3422,9 @@ irc_command_voice (void *data, struct t_gui_buffer *buffer, int argc,
else
{
weechat_printf (ptr_server->buffer,
- _("%sirc: \"%s\" command can only be "
+ _("%s%s: \"%s\" command can only be "
"executed in a channel buffer"),
- weechat_prefix ("error"), "voice");
+ weechat_prefix ("error"), "irc", "voice");
return WEECHAT_RC_ERROR;
}
return WEECHAT_RC_OK;
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index d3c0ae443..a109d3cbc 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -238,19 +238,18 @@ irc_config_read_server_line (struct t_config_file *config_file,
break;
case 0:
weechat_printf (NULL,
- _("%sirc: warning, failed to set option "
- "\"%s\" with value \"%s\""),
- weechat_prefix ("error"),
- option_name, value);
+ _("%s%s: value \"%s\" is invalid "
+ "for option \"%s\""),
+ weechat_prefix ("error"), "irc",
+ value, option_name);
break;
}
}
else
{
weechat_printf (NULL,
- _("%sirc: warning, option not found in config "
- "file: \"%s\""),
- weechat_prefix ("error"),
+ _("%s%s: option \"%s\" not found"),
+ weechat_prefix ("error"), "irc",
option_name);
}
}
@@ -269,8 +268,8 @@ irc_config_read_server_line (struct t_config_file *config_file,
if (!irc_config_server)
{
weechat_printf (NULL,
- _("%sirc: error creating server for reading "
- "config file"),
+ _("%s%s: error creating server for reading "
+ "configuration file"), "irc",
weechat_prefix ("error"));
}
}
@@ -769,10 +768,10 @@ irc_config_reload_cb (void *data, char *event, void *pointer)
if (ptr_server->is_connected)
{
weechat_printf (NULL,
- _("%sirc: warning: server \"%s\" not found in "
- "configuration file, but was not deleted "
- "(currently used)"),
- weechat_prefix ("info"),
+ _("%s%s: warning: server \"%s\" not found "
+ "in configuration file. It has not been "
+ "deleted because it's used now."),
+ weechat_prefix ("info"), "irc",
ptr_server->name);
}
else
@@ -783,15 +782,14 @@ irc_config_reload_cb (void *data, char *event, void *pointer)
}
weechat_printf (NULL,
- _("%sirc: configuration file reloaded"),
- weechat_prefix ("info"));
+ _("%s%s: configuration file reloaded"),
+ weechat_prefix ("info"), "irc");
return WEECHAT_RC_OK;
}
weechat_printf (NULL,
- _("%sirc: failed to reload alias configuration "
- "file"),
- weechat_prefix ("error"));
+ _("%s%s: failed to reload configuration file"),
+ weechat_prefix ("error"), "irc");
return WEECHAT_RC_ERROR;
}
diff --git a/src/plugins/irc/irc-display.c b/src/plugins/irc/irc-display.c
index 8dfead1f7..6d48de902 100644
--- a/src/plugins/irc/irc-display.c
+++ b/src/plugins/irc/irc-display.c
@@ -354,7 +354,7 @@ irc_display_server (struct t_irc_server *server, int with_detail)
(server->autoreconnect) ? _("on") : _("off"));
weechat_printf (NULL, " server_autoreconnect_delay : %d %s",
server->autoreconnect_delay,
- _("seconds"));
+ NG_("second", "seconds", server->autoreconnect_delay));
weechat_printf (NULL, " server_address . . . . . . : %s",
server->address);
weechat_printf (NULL, " server_port . . . . . . . : %d",
@@ -399,7 +399,7 @@ irc_display_server (struct t_irc_server *server, int with_detail)
server->command : "");
weechat_printf (NULL, " server_command_delay . . . : %d %s",
server->command_delay,
- _("seconds"));
+ NG_("second", "seconds", server->command_delay));
weechat_printf (NULL, " server_autojoin . . . . . : %s",
(server->autojoin && server->autojoin[0]) ?
server->autojoin : "");
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c
index 3e657977f..aa848ba69 100644
--- a/src/plugins/irc/irc-protocol.c
+++ b/src/plugins/irc/irc-protocol.c
@@ -577,7 +577,7 @@ irc_protocol_cmd_error (struct t_irc_server *server, char *irc_message, char *ho
pos = strchr (arguments, ' ');
if (pos)
pos[0] = '\0';
- if (strcasecmp (arguments, server->nick) != 0)
+ if (weechat_strcasecmp (arguments, server->nick) != 0)
{
if (first)
{
@@ -658,9 +658,9 @@ irc_protocol_cmd_invite (struct t_irc_server *server, char *irc_message, char *h
else
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for "
+ _("%s%s: channel \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"), "", "invite");
+ weechat_prefix ("error"), "irc", "", "invite");
return WEECHAT_RC_ERROR;
}
@@ -688,8 +688,8 @@ irc_protocol_cmd_join (struct t_irc_server *server, char *irc_message, char *hos
if (!host)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without host"),
- weechat_prefix ("error"), "join");
+ _("%s%s: \"%s\" command received without host"),
+ weechat_prefix ("error"), "irc", "join");
return WEECHAT_RC_ERROR;
}
@@ -704,8 +704,8 @@ irc_protocol_cmd_join (struct t_irc_server *server, char *irc_message, char *hos
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot create new channel \"%s\""),
- weechat_prefix ("error"), arguments);
+ _("%s%s: cannot create new channel \"%s\""),
+ weechat_prefix ("error"), "irc", arguments);
return WEECHAT_RC_ERROR;
}
}
@@ -791,9 +791,10 @@ irc_protocol_cmd_kick (struct t_irc_server *server, char *irc_message, char *hos
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for "
+ _("%s%s: channel \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"), arguments, "kick");
+ weechat_prefix ("error"), "irc", arguments,
+ "kick");
return WEECHAT_RC_ERROR;
}
@@ -836,9 +837,9 @@ irc_protocol_cmd_kick (struct t_irc_server *server, char *irc_message, char *hos
else
{
weechat_printf (server->buffer,
- _("%sirc: nick \"%s\" not found for \"%s\" "
+ _("%s%s: nick \"%s\" not found for \"%s\" "
"command"),
- weechat_prefix ("error"), "", "kick");
+ weechat_prefix ("error"), "irc", "", "kick");
return WEECHAT_RC_ERROR;
}
if (strcmp (pos_nick, server->nick) == 0)
@@ -916,8 +917,9 @@ irc_protocol_cmd_kill (struct t_irc_server *server, char *irc_message,
if (pos_comment)
{
weechat_printf (ptr_channel->buffer,
- _("%s%s%s has killed %s%s%s from "
+ _("%s%s%s%s has killed %s%s%s from "
"server %s(%s%s%s)"),
+ weechat_prefix ("quit"),
IRC_COLOR_CHAT_NICK,
nick,
IRC_COLOR_CHAT,
@@ -932,8 +934,9 @@ irc_protocol_cmd_kill (struct t_irc_server *server, char *irc_message,
else
{
weechat_printf (ptr_channel->buffer,
- _("%s%s%s has killed %s%s%s from "
+ _("%s%s%s%s has killed %s%s%s from "
"server"),
+ weechat_prefix ("quit"),
IRC_COLOR_CHAT_NICK,
nick,
IRC_COLOR_CHAT,
@@ -947,9 +950,8 @@ irc_protocol_cmd_kill (struct t_irc_server *server, char *irc_message,
else
{
weechat_printf (server->buffer,
- _("%s host not found for \"%s\" "
- "command\n"),
- weechat_prefix ("error"), "kill");
+ _("%s%s: host not found for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "kill");
return WEECHAT_RC_ERROR;
}
@@ -975,9 +977,9 @@ irc_protocol_cmd_mode (struct t_irc_server *server, char *irc_message, char *hos
if (!host)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without "
+ _("%s%s: \"%s\" command received without "
"host"),
- weechat_prefix ("error"), "mode");
+ weechat_prefix ("error"), "irc", "mode");
return WEECHAT_RC_ERROR;
}
@@ -985,9 +987,9 @@ irc_protocol_cmd_mode (struct t_irc_server *server, char *irc_message, char *hos
if (!pos_modes)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without "
+ _("%s%s: \"%s\" command received without "
"channel or nickname"),
- weechat_prefix ("error"), "mode");
+ weechat_prefix ("error"), "irc", "mode");
return WEECHAT_RC_ERROR;
}
pos_modes[0] = '\0';
@@ -1031,9 +1033,10 @@ irc_protocol_cmd_mode (struct t_irc_server *server, char *irc_message, char *hos
else
{
weechat_printf (server->buffer,
- _("%s channel \"%s\" not found for \"%s\" "
+ _("%s%s: channel \"%s\" not found for \"%s\" "
"command"),
- weechat_prefix ("error"), arguments, "mode");
+ weechat_prefix ("error"), "irc", arguments,
+ "mode");
return WEECHAT_RC_ERROR;
}
}
@@ -1079,8 +1082,8 @@ irc_protocol_cmd_nick (struct t_irc_server *server, char *irc_message, char *hos
if (!host)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without host"),
- weechat_prefix ("error"), "nick");
+ _("%s%s: \"%s\" command received without host"),
+ weechat_prefix ("error"), "irc", "nick");
return WEECHAT_RC_ERROR;
}
@@ -1200,8 +1203,8 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *irc_message, char *h
else
{
weechat_printf (server->buffer,
- _("%s nickname not found for \"%s\" command"),
- weechat_prefix ("error"), "notice");
+ _("%s%s: nickname not found for \"%s\" command"),
+ weechat_prefix ("error"), "irc", "notice");
return WEECHAT_RC_ERROR;
}
@@ -1250,14 +1253,16 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *irc_message, char *h
weechat_printf (server->buffer,
_("CTCP %sPING%s reply from "
- "%s%s%s: %ld.%ld seconds\n"),
+ "%s%s%s: %ld.%ld %s"),
IRC_COLOR_CHAT_CHANNEL,
IRC_COLOR_CHAT,
IRC_COLOR_CHAT_NICK,
nick,
IRC_COLOR_CHAT,
difftime / 1000000,
- (difftime % 1000000) / 1000);
+ (difftime % 1000000) / 1000,
+ (NG_("second", "seconds",
+ (difftime / 1000000))));
}
}
}
@@ -1275,9 +1280,10 @@ irc_protocol_cmd_notice (struct t_irc_server *server, char *irc_message, char *h
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot create new "
+ _("%s%s: cannot create new "
"private buffer \"%s\""),
- weechat_prefix ("error"), nick);
+ weechat_prefix ("error"), "irc",
+ nick);
return WEECHAT_RC_ERROR;
}
}
@@ -1391,9 +1397,9 @@ irc_protocol_cmd_part (struct t_irc_server *server, char *irc_message, char *hos
if (!host || !arguments)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without host or "
+ _("%s%s: \"%s\" command received without host or "
"channel"),
- weechat_prefix ("error"), "part");
+ weechat_prefix ("error"), "irc", "part");
return WEECHAT_RC_ERROR;
}
@@ -1505,9 +1511,9 @@ irc_protocol_cmd_part (struct t_irc_server *server, char *irc_message, char *hos
else
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for \"%s\" "
+ _("%s%s: channel \"%s\" not found for \"%s\" "
"command"),
- weechat_prefix ("error"), arguments, "part");
+ weechat_prefix ("error"), "irc", arguments, "part");
return WEECHAT_RC_ERROR;
}
@@ -1589,7 +1595,7 @@ void
irc_protocol_reply_version (struct t_irc_server *server, struct t_irc_channel *channel,
char *nick, char *message, int ignore)
{
- char *pos;
+ char *pos, *version, *date;
struct utsname *buf;
struct t_gui_buffer *ptr_buffer;
@@ -1607,45 +1613,54 @@ irc_protocol_reply_version (struct t_irc_server *server, struct t_irc_channel *c
else if (!pos[0])
pos = NULL;
}
-
- buf = (struct utsname *)malloc (sizeof (struct utsname));
- if (buf && (uname (buf) >= 0))
- {
- irc_server_sendf (server,
- "NOTICE %s :%sVERSION %s v%s"
- " compiled on %s, running "
- "%s %s / %s%s",
- nick, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
- &buf->sysname,
- &buf->release, &buf->machine, "\01");
- free (buf);
- }
- else
- irc_server_sendf (server,
- "NOTICE %s :%sVERSION %s v%s"
- " compiled on %s%s",
- nick, "\01", PACKAGE_NAME, PACKAGE_VERSION, __DATE__,
- "\01");
- if (pos)
- {
- weechat_printf (ptr_buffer,
- _("CTCP %sVERSION%s received from %s%s%s: %s"),
- IRC_COLOR_CHAT_CHANNEL,
- IRC_COLOR_CHAT,
- IRC_COLOR_CHAT_NICK,
- nick,
- IRC_COLOR_CHAT,
- pos);
- }
- else
+
+ version = weechat_info_get ("version");
+ date = weechat_info_get ("date");
+ if (version && date)
{
- weechat_printf (ptr_buffer,
- _("CTCP %sVERSION%s received from %s%s"),
- IRC_COLOR_CHAT_CHANNEL,
- IRC_COLOR_CHAT,
- IRC_COLOR_CHAT_NICK,
- nick);
+ buf = (struct utsname *)malloc (sizeof (struct utsname));
+ if (buf && (uname (buf) >= 0))
+ {
+ irc_server_sendf (server,
+ "NOTICE %s :%sVERSION %s v%s"
+ " compiled on %s, running "
+ "%s %s / %s%s",
+ nick, "\01", "WeeChat", version, date,
+ &buf->sysname,
+ &buf->release, &buf->machine, "\01");
+ free (buf);
+ }
+ else
+ irc_server_sendf (server,
+ "NOTICE %s :%sVERSION %s v%s"
+ " compiled on %s%s",
+ nick, "\01", "WeeChat", version, date,
+ "\01");
+ if (pos)
+ {
+ weechat_printf (ptr_buffer,
+ _("CTCP %sVERSION%s received from %s%s%s: %s"),
+ IRC_COLOR_CHAT_CHANNEL,
+ IRC_COLOR_CHAT,
+ IRC_COLOR_CHAT_NICK,
+ nick,
+ IRC_COLOR_CHAT,
+ pos);
+ }
+ else
+ {
+ weechat_printf (ptr_buffer,
+ _("CTCP %sVERSION%s received from %s%s"),
+ IRC_COLOR_CHAT_CHANNEL,
+ IRC_COLOR_CHAT,
+ IRC_COLOR_CHAT_NICK,
+ nick);
+ }
}
+ if (version)
+ free (version);
+ if (date)
+ free (date);
//(void) plugin_msg_handler_exec (server->name,
// "weechat_ctcp",
// irc_message);
@@ -1673,8 +1688,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!host)
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without host"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: \"%s\" command received without host"),
+ weechat_prefix ("error"), "irc", "privmsg");
return WEECHAT_RC_ERROR;
}
@@ -1884,9 +1899,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
else
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for \"%s\" "
+ _("%s%s: channel \"%s\" not found for \"%s\" "
"command"),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
arguments, "privmsg");
return WEECHAT_RC_ERROR;
}
@@ -1953,8 +1968,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos2)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2[0] = '\0';
@@ -1971,8 +1987,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_size)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_size;
@@ -1986,8 +2003,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_port)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_port;
@@ -2001,8 +2019,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_addr)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_addr;
@@ -2030,8 +2049,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos2)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2[0] = '\0';
@@ -2048,8 +2068,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_start_resume)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_start_resume;
@@ -2063,8 +2084,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_port)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_port;
@@ -2090,8 +2112,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos2)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2[0] = '\0';
@@ -2108,8 +2131,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_start_resume)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_start_resume;
@@ -2123,8 +2147,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_port)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2 = pos_port;
@@ -2150,8 +2175,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos2)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos2[0] = '\0';
@@ -2168,8 +2194,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_addr)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos_addr[0] = '\0';
@@ -2182,8 +2209,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!pos_port)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc",
+ "privmsg");
return WEECHAT_RC_ERROR;
}
pos_port[0] = '\0';
@@ -2194,9 +2222,9 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (weechat_strcasecmp (pos_file, "chat") != 0)
{
weechat_printf (server->buffer,
- _("%sirc: unknown DCC CHAT type "
+ _("%s%s: unknown DCC CHAT type "
"received from %s%s%s: \"%s\""),
- weechat_prefix ("error"),
+ weechat_prefix ("error"), "irc",
IRC_COLOR_CHAT_NICK,
nick,
IRC_COLOR_CHAT,
@@ -2229,9 +2257,10 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot create new "
+ _("%s%s: cannot create new "
"private buffer \"%s\""),
- weechat_prefix ("error"), nick);
+ weechat_prefix ("error"), "irc",
+ nick);
return WEECHAT_RC_ERROR;
}
}
@@ -2342,10 +2371,10 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%s cannot create new "
+ _("%s%s: cannot create new "
"private buffer \"%s\""),
weechat_prefix ("error"),
- nick);
+ "irc", nick);
return WEECHAT_RC_ERROR;
}
}
@@ -2395,8 +2424,8 @@ irc_protocol_cmd_privmsg (struct t_irc_server *server, char *irc_message, char *
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "privmsg");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "privmsg");
return WEECHAT_RC_ERROR;
}
}
@@ -2424,8 +2453,8 @@ irc_protocol_cmd_quit (struct t_irc_server *server, char *irc_message, char *hos
if (!host)
{
weechat_printf (server->buffer,
- _("irc:%s \"%s\" command received without host"),
- weechat_prefix ("error"), "quit");
+ _("%s%s: \"%s\" command received without host"),
+ weechat_prefix ("error"), "irc", "quit");
return WEECHAT_RC_ERROR;
}
@@ -2540,7 +2569,7 @@ irc_protocol_cmd_server_msg (struct t_irc_server *server, char *irc_message,
arguments++;
/* skip nickname if at beginning of server message */
- if (strncasecmp (server->nick, arguments, strlen (server->nick)) == 0)
+ if (weechat_strncasecmp (server->nick, arguments, strlen (server->nick)) == 0)
{
arguments += strlen (server->nick) + 1;
while (arguments[0] == ' ')
@@ -2578,8 +2607,8 @@ irc_protocol_cmd_topic (struct t_irc_server *server, char *irc_message, char *ho
if (!irc_channel_is_channel (arguments))
{
weechat_printf (server->buffer,
- _("%sirc: \"%s\" command received without channel"),
- weechat_prefix ("error"), "topic");
+ _("%s%s: \"%s\" command received without channel"),
+ weechat_prefix ("error"), "irc", "topic");
return WEECHAT_RC_ERROR;
}
@@ -2819,8 +2848,8 @@ irc_protocol_cmd_221 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "221");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "221");
return WEECHAT_RC_ERROR;
}
@@ -3509,19 +3538,19 @@ irc_protocol_cmd_317 (struct t_irc_server *server, char *irc_message, char *host
IRC_COLOR_CHAT_CHANNEL,
day,
IRC_COLOR_CHAT,
- (day > 1) ? _("days") : _("day"),
+ NG_("day", "days", day),
IRC_COLOR_CHAT_CHANNEL,
hour,
IRC_COLOR_CHAT,
- (hour > 1) ? _("hours") : _("hour"),
+ NG_("hour", "hours", hour),
IRC_COLOR_CHAT_CHANNEL,
min,
IRC_COLOR_CHAT,
- (min > 1) ? _("minutes") : _("minute"),
+ NG_("minute", "minutes", min),
IRC_COLOR_CHAT_CHANNEL,
sec,
IRC_COLOR_CHAT,
- (sec > 1) ? _("seconds") : _("second"),
+ NG_("second", "seconds", sec),
IRC_COLOR_CHAT_CHANNEL,
ctime (&datetime));
}
@@ -3539,15 +3568,15 @@ irc_protocol_cmd_317 (struct t_irc_server *server, char *irc_message, char *host
IRC_COLOR_CHAT_CHANNEL,
hour,
IRC_COLOR_CHAT,
- (hour > 1) ? _("hours") : _("hour"),
+ NG_("hour", "hours", hour),
IRC_COLOR_CHAT_CHANNEL,
min,
IRC_COLOR_CHAT,
- (min > 1) ? _("minutes") : _("minute"),
+ NG_("minute", "minutes", min),
IRC_COLOR_CHAT_CHANNEL,
sec,
IRC_COLOR_CHAT,
- (sec > 1) ? _("seconds") : _("second"),
+ NG_("second", "seconds", sec),
IRC_COLOR_CHAT_CHANNEL,
ctime (&datetime));
}
@@ -3945,9 +3974,10 @@ irc_protocol_cmd_329 (struct t_irc_server *server, char *irc_message, char *host
if (!ptr_channel)
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for "
+ _("%s%s: channel \"%s\" not found for "
"\"%s\" command"),
- weechat_prefix ("error"), pos_channel, "329");
+ weechat_prefix ("error"), "irc", pos_channel,
+ "329");
return WEECHAT_RC_ERROR;
}
@@ -3964,18 +3994,18 @@ irc_protocol_cmd_329 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify date/time for \"%s\" "
+ _("%s%s: cannot identify date/time for \"%s\" "
"command"),
- weechat_prefix ("error"), "329");
+ weechat_prefix ("error"), "irc", "329");
return WEECHAT_RC_ERROR;
}
}
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify channel for \"%s\" "
+ _("%s%s: cannot identify channel for \"%s\" "
"command"),
- weechat_prefix ("error"), "329");
+ weechat_prefix ("error"), "irc", "329");
return WEECHAT_RC_ERROR;
}
@@ -4015,9 +4045,9 @@ irc_protocol_cmd_331 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: channel \"%s\" not found for \"%s\" "
+ _("%s%s: channel \"%s\" not found for \"%s\" "
"command"),
- weechat_prefix ("error"), "", "331");
+ weechat_prefix ("error"), "irc", "", "331");
return WEECHAT_RC_ERROR;
}
@@ -4097,9 +4127,9 @@ irc_protocol_cmd_332 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify channel for \"%s\" "
+ _("%s%s: cannot identify channel for \"%s\" "
"command"),
- weechat_prefix ("error"), "332");
+ weechat_prefix ("error"), "irc", "332");
return WEECHAT_RC_ERROR;
}
@@ -4170,9 +4200,9 @@ irc_protocol_cmd_333 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify channel for \"%s\" "
+ _("%s%s: cannot identify channel for \"%s\" "
"command"),
- weechat_prefix ("error"), "333");
+ weechat_prefix ("error"), "irc", "333");
return WEECHAT_RC_ERROR;
}
@@ -4220,7 +4250,7 @@ irc_protocol_cmd_338 (struct t_irc_server *server, char *irc_message, char *host
pos_message++;
weechat_printf (server->buffer,
- "%s[%s%s%s] %s%s %s%s %s%s\n",
+ "%s[%s%s%s] %s%s %s%s %s%s",
IRC_COLOR_CHAT_DELIMITERS,
IRC_COLOR_CHAT_NICK,
pos_nick,
@@ -4291,18 +4321,18 @@ irc_protocol_cmd_341 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify channel for \"%s\" "
+ _("%s%s: cannot identify channel for \"%s\" "
"command"),
- weechat_prefix ("error"), "341");
+ weechat_prefix ("error"), "irc", "341");
return WEECHAT_RC_ERROR;
}
}
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot identify nickname for \"%s\" "
+ _("%s%s: cannot identify nickname for \"%s\" "
"command"),
- weechat_prefix ("error"), "341");
+ weechat_prefix ("error"), "irc", "341");
return WEECHAT_RC_ERROR;
}
@@ -4426,8 +4456,8 @@ irc_protocol_cmd_348 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "348");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "348");
return WEECHAT_RC_ERROR;
}
pos_channel[0] = '\0';
@@ -4440,8 +4470,8 @@ irc_protocol_cmd_348 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_exception)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "348");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "348");
return WEECHAT_RC_ERROR;
}
pos_exception[0] = '\0';
@@ -4543,8 +4573,8 @@ irc_protocol_cmd_349 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "349");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "349");
return WEECHAT_RC_ERROR;
}
pos_channel[0] = '\0';
@@ -4556,8 +4586,8 @@ irc_protocol_cmd_349 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_msg)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "349");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "349");
return WEECHAT_RC_ERROR;
}
pos_msg[0] = '\0';
@@ -4811,8 +4841,8 @@ irc_protocol_cmd_353 (struct t_irc_server *server, char *irc_message, char *host
if (pos[0] != ':')
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "353");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "353");
return WEECHAT_RC_ERROR;
}
@@ -4904,10 +4934,10 @@ irc_protocol_cmd_353 (struct t_irc_server *server, char *irc_message, char *host
is_op, is_halfop, has_voice, is_chanuser))
{
weechat_printf (server->buffer,
- _("%sirc: cannot create nick \"%s\" "
+ _("%s%s: cannot create nick \"%s\" "
"for channel \"%s\""),
- weechat_prefix ("error"), pos_nick,
- ptr_channel->name);
+ weechat_prefix ("error"), "irc",
+ pos_nick, ptr_channel->name);
}
}
else
@@ -4936,8 +4966,8 @@ irc_protocol_cmd_353 (struct t_irc_server *server, char *irc_message, char *host
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "353");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "353");
return WEECHAT_RC_ERROR;
}
@@ -5009,7 +5039,7 @@ irc_protocol_cmd_366 (struct t_irc_server *server, char *irc_message, char *host
&num_normal);
weechat_printf (ptr_channel->buffer,
_("%sChannel %s%s%s: %s%d%s %s %s(%s%d%s %s, "
- "%s%d%s %s, %s%d%s %s, %s%d%s %s%s)\n"),
+ "%s%d%s %s, %s%d%s %s, %s%d%s %s%s)"),
weechat_prefix ("info"),
IRC_COLOR_CHAT_CHANNEL,
ptr_channel->name,
@@ -5083,8 +5113,8 @@ irc_protocol_cmd_367 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "367");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "367");
return WEECHAT_RC_ERROR;
}
pos_channel[0] = '\0';
@@ -5097,8 +5127,8 @@ irc_protocol_cmd_367 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_ban)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "367");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "367");
return WEECHAT_RC_ERROR;
}
pos_ban[0] = '\0';
@@ -5208,8 +5238,8 @@ irc_protocol_cmd_368 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_channel)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "368");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "368");
return WEECHAT_RC_ERROR;
}
pos_channel[0] = '\0';
@@ -5221,8 +5251,8 @@ irc_protocol_cmd_368 (struct t_irc_server *server, char *irc_message, char *host
if (!pos_msg)
{
weechat_printf (server->buffer,
- _("%sirc: cannot parse \"%s\" command"),
- weechat_prefix ("error"), "368");
+ _("%s%s: cannot parse \"%s\" command"),
+ weechat_prefix ("error"), "irc", "368");
return WEECHAT_RC_ERROR;
}
pos_msg[0] = '\0';
@@ -5269,9 +5299,9 @@ irc_protocol_cmd_432 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick1) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is invalid, "
+ _("%s%s: nickname \"%s\" is invalid, "
"trying 2nd nickname \"%s\""),
- weechat_prefix ("info"), server->nick,
+ weechat_prefix ("info"), "irc", server->nick,
server->nick2);
free (server->nick);
server->nick = strdup (server->nick2);
@@ -5281,9 +5311,9 @@ irc_protocol_cmd_432 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick2) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is invalid, "
+ _("%s%s: nickname \"%s\" is invalid, "
"trying 3rd nickname \"%s\""),
- weechat_prefix ("info"), server->nick,
+ weechat_prefix ("info"), "irc", server->nick,
server->nick3);
free (server->nick);
server->nick = strdup (server->nick3);
@@ -5293,20 +5323,20 @@ irc_protocol_cmd_432 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick3) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: all declared nicknames are "
+ _("%s%s: all declared nicknames are "
"already in use or invalid, closing "
"connection with server!"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
irc_server_disconnect (server, 1);
return WEECHAT_RC_OK;
}
else
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is invalid, "
+ _("%s%s: nickname \"%s\" is invalid, "
"trying 1st nickname \"%s\""),
- weechat_prefix ("info"), server->nick,
- server->nick1);
+ weechat_prefix ("info"), "irc",
+ server->nick, server->nick1);
free (server->nick);
server->nick = strdup (server->nick1);
}
@@ -5333,9 +5363,9 @@ irc_protocol_cmd_433 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick1) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is already in use, "
+ _("%s%s: nickname \"%s\" is already in use, "
"trying 2nd nickname \"%s\""),
- weechat_prefix ("info"), server->nick,
+ weechat_prefix ("info"), "irc", server->nick,
server->nick2);
free (server->nick);
server->nick = strdup (server->nick2);
@@ -5345,9 +5375,10 @@ irc_protocol_cmd_433 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick2) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is already in use, "
+ _("%s%s: nickname \"%s\" is already in use, "
"trying 3rd nickname \"%s\""),
- PACKAGE_NAME, server->nick, server->nick3);
+ weechat_prefix ("info"), "irc", server->nick,
+ server->nick3);
free (server->nick);
server->nick = strdup (server->nick3);
}
@@ -5356,19 +5387,20 @@ irc_protocol_cmd_433 (struct t_irc_server *server, char *irc_message, char *host
if (strcmp (server->nick, server->nick3) == 0)
{
weechat_printf (server->buffer,
- _("%sirc: all declared nicknames are "
+ _("%s%s: all declared nicknames are "
"already in use, closing connection "
"with server!"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
irc_server_disconnect (server, 1);
return WEECHAT_RC_OK;
}
else
{
weechat_printf (server->buffer,
- _("%sirc: nickname \"%s\" is already in use, "
+ _("%s%s: nickname \"%s\" is already in use, "
"trying 1st nickname \"%s\""),
- PACKAGE_NAME, server->nick, server->nick1);
+ weechat_prefix ("info"), "irc",
+ server->nick, server->nick1);
free (server->nick);
server->nick = strdup (server->nick1);
}
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 0b9ac0906..4257a1a11 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -152,24 +152,24 @@ irc_server_init_with_url (struct t_irc_server *server, char *irc_url)
irc_server_init (server);
ipv6 = 0;
ssl = 0;
- if (strncasecmp (irc_url, "irc6://", 7) == 0)
+ if (weechat_strncasecmp (irc_url, "irc6://", 7) == 0)
{
pos = irc_url + 7;
ipv6 = 1;
}
- else if (strncasecmp (irc_url, "ircs://", 7) == 0)
+ else if (weechat_strncasecmp (irc_url, "ircs://", 7) == 0)
{
pos = irc_url + 7;
ssl = 1;
}
- else if ((strncasecmp (irc_url, "irc6s://", 8) == 0)
- || (strncasecmp (irc_url, "ircs6://", 8) == 0))
+ else if ((weechat_strncasecmp (irc_url, "irc6s://", 8) == 0)
+ || (weechat_strncasecmp (irc_url, "ircs6://", 8) == 0))
{
pos = irc_url + 8;
ipv6 = 1;
ssl = 1;
}
- else if (strncasecmp (irc_url, "irc://", 6) == 0)
+ else if (weechat_strncasecmp (irc_url, "irc://", 6) == 0)
{
pos = irc_url + 6;
}
@@ -202,8 +202,8 @@ irc_server_init_with_url (struct t_irc_server *server, char *irc_url)
else
{
weechat_printf (NULL,
- _("%sirc: error retrieving user's name: %s"),
- weechat_prefix ("error"),
+ _("%s%s: error retrieving user's name: %s"),
+ weechat_prefix ("error"), "irc",
strerror (errno));
free (url);
return -1;
@@ -426,8 +426,8 @@ irc_server_alloc ()
if ((new_server = (struct t_irc_server *)malloc (sizeof (struct t_irc_server))) == NULL)
{
weechat_printf (NULL,
- _("%sirc: error when allocating new server"),
- weechat_prefix ("error"));
+ _("%s%s: error when allocating new server"),
+ weechat_prefix ("error"), "irc");
return NULL;
}
@@ -759,19 +759,19 @@ irc_server_send (struct t_irc_server *server, char *buffer, int size_buf)
if (!server)
{
weechat_printf (NULL,
- _("%sirc: error sending data to IRC server: null "
+ _("%s%s: error sending data to IRC server: null "
"pointer (please report problem to developers)"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
return 0;
}
if (size_buf <= 0)
{
weechat_printf (server->buffer,
- _("%sirc: error sending data to IRC server: empty "
+ _("%s%s: error sending data to IRC server: empty "
"buffer (please report problem to "
"developers)"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
return 0;
}
@@ -785,8 +785,8 @@ irc_server_send (struct t_irc_server *server, char *buffer, int size_buf)
if (rc < 0)
{
weechat_printf (server->buffer,
- _("%sirc: error sending data to IRC server (%s)"),
- weechat_prefix ("error"),
+ _("%s%s: error sending data to IRC server (%s)"),
+ weechat_prefix ("error"), "irc",
strerror (errno));
}
@@ -829,14 +829,8 @@ irc_server_outqueue_send (struct t_irc_server *server)
if (pos)
pos[0] = '\r';
}
- if (irc_server_send (server, server->outqueue->message_after_mod,
- strlen (server->outqueue->message_after_mod)) < 0)
- {
- weechat_printf (server->buffer,
- _("%sirc: error sending data to IRC "
- "server"),
- weechat_prefix ("error"));
- }
+ irc_server_send (server, server->outqueue->message_after_mod,
+ strlen (server->outqueue->message_after_mod));
server->last_user_message = time_now;
irc_server_outqueue_free (server, server->outqueue);
}
@@ -914,13 +908,7 @@ irc_server_send_one_msg (struct t_irc_server *server, char *message)
//if (new_msg)
// gui_chat_printf_raw_data (server, 1, 1, ptr_msg);
if (irc_server_send (server, buffer, strlen (buffer)) <= 0)
- {
- weechat_printf (server->buffer,
- _("%sirc: error sending data to IRC "
- "server"),
- weechat_prefix ("error"));
rc = 0;
- }
else
{
if (server->queue_msg)
@@ -1048,9 +1036,9 @@ irc_server_msgq_add_msg (struct t_irc_server *server, char *msg)
if (!message)
{
weechat_printf (server->buffer,
- _("%sirc: not enough memory for received IRC "
+ _("%s%s: not enough memory for received IRC "
"message"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
return;
}
message->server = server;
@@ -1061,9 +1049,9 @@ irc_server_msgq_add_msg (struct t_irc_server *server, char *msg)
if (!message->data)
{
weechat_printf (server->buffer,
- _("%sirc: not enough memory for received IRC "
+ _("%s%s: not enough memory for received IRC "
"message"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
else
{
@@ -1108,9 +1096,9 @@ irc_server_msgq_add_unterminated (struct t_irc_server *server, char *string)
if (!server->unterminated_message)
{
weechat_printf (server->buffer,
- _("%sirc: not enough memory for received IRC "
+ _("%s%s: not enough memory for received IRC "
"message"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
else
strcat (server->unterminated_message, string);
@@ -1121,9 +1109,9 @@ irc_server_msgq_add_unterminated (struct t_irc_server *server, char *string)
if (!server->unterminated_message)
{
weechat_printf (server->buffer,
- _("%sirc: not enough memory for received IRC "
+ _("%s%s: not enough memory for received IRC "
"message"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
}
}
@@ -1236,25 +1224,26 @@ irc_server_msgq_flush ()
{
case -1:
weechat_printf (irc_recv_msgq->server->buffer,
- _("%sirc: command \"%s\" "
- "failed!"),
+ _("%s%s: command \"%s\" "
+ "failed"),
weechat_prefix ("error"),
- command);
+ "irc", command);
break;
case -2:
weechat_printf (irc_recv_msgq->server->buffer,
- _("%sirc: no command to "
- "execute!"),
- weechat_prefix ("error"));
+ _("%s%s: no command to "
+ "execute"),
+ weechat_prefix ("error"),
+ "irc");
break;
case -3:
weechat_printf (irc_recv_msgq->server->buffer,
- _("%sirc: unknown command: "
+ _("%s%s: unknown command: "
"cmd=\"%s\", "
"host=\"%s\", "
"args=\"%s\""),
weechat_prefix ("error"),
- command, host, args);
+ "irc", command, host, args);
break;
}
@@ -1325,9 +1314,9 @@ irc_server_recv_cb (void *arg_server)
else
{
weechat_printf (server->buffer,
- _("%sirc: cannot read data from socket, "
+ _("%s%s: cannot read data from socket, "
"disconnecting from server..."),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
irc_server_disconnect (server, 1);
}
@@ -1392,10 +1381,10 @@ irc_server_timer_cb (void *empty)
if (diff / 1000 > weechat_config_integer (irc_config_irc_lag_disconnect) * 60)
{
weechat_printf (ptr_server->buffer,
- _("%sirc: lag is high, "
+ _("%s%s: lag is high, "
"disconnecting from "
"server..."),
- weechat_prefix ("info"));
+ weechat_prefix ("info"), "irc");
irc_server_disconnect (ptr_server, 1);
}
}
@@ -1495,9 +1484,11 @@ irc_server_reconnect_schedule (struct t_irc_server *server)
{
server->reconnect_start = time (NULL);
weechat_printf (server->buffer,
- _("%sirc: reconnecting to server in %d seconds"),
- weechat_prefix ("info"),
- server->autoreconnect_delay);
+ _("%s%s: reconnecting to server in %d %s"),
+ weechat_prefix ("info"), "irc",
+ server->autoreconnect_delay,
+ NG_("second", "seconds",
+ server->autoreconnect_delay));
}
else
server->reconnect_start = 0;
@@ -1555,8 +1546,8 @@ irc_server_child_read (void *arg_server)
if (gnutls_handshake (server->gnutls_sess) < 0)
{
weechat_printf (server->buffer,
- _("%sirc: GnuTLS handshake failed"),
- weechat_prefix ("error"));
+ _("%s%s: GnuTLS handshake failed"),
+ weechat_prefix ("error"), "irc");
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
return WEECHAT_RC_OK;
@@ -1576,9 +1567,9 @@ irc_server_child_read (void *arg_server)
case '1':
weechat_printf (server->buffer,
(config_proxy_use) ?
- _("%sirc: proxy address \"%s\" not found") :
- _("%sirc: address \"%s\" not found"),
- weechat_prefix ("error"),
+ _("%s%s: proxy address \"%s\" not found") :
+ _("%s%s: address \"%s\" not found"),
+ weechat_prefix ("error"), "irc",
server->address);
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
@@ -1587,9 +1578,9 @@ irc_server_child_read (void *arg_server)
case '2':
weechat_printf (server->buffer,
(config_proxy_use) ?
- _("%sirc: proxy IP address not found") :
- _("%sirc: IP address not found"),
- weechat_prefix ("error"));
+ _("%s%s: proxy IP address not found") :
+ _("%s%s: IP address not found"),
+ weechat_prefix ("error"), "irc");
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
@@ -1597,27 +1588,27 @@ irc_server_child_read (void *arg_server)
case '3':
weechat_printf (server->buffer,
(config_proxy_use) ?
- _("%sirc: proxy connection refused") :
- _("%sirc: connection refused"),
- weechat_prefix ("error"));
+ _("%s%s: proxy connection refused") :
+ _("%s%s: connection refused"),
+ weechat_prefix ("error"), "irc");
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
/* proxy fails to connect to server */
case '4':
weechat_printf (server->buffer,
- _("%sirc: proxy fails to establish "
+ _("%s%s: proxy fails to establish "
"connection to server "
"(check username/password if used)"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
/* fails to set local hostname/IP */
case '5':
weechat_printf (server->buffer,
- _("%sirc: unable to set local hostname/IP"),
- weechat_prefix ("error"));
+ _("%s%s: unable to set local hostname/IP"),
+ weechat_prefix ("error"), "irc");
irc_server_close_connection (server);
irc_server_reconnect_schedule (server);
break;
@@ -2189,18 +2180,18 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
if (server->ssl)
{
weechat_printf (server->buffer,
- _("%sirc: cannot connect with SSL since WeeChat "
+ _("%s%s: cannot connect with SSL since WeeChat "
"was not built with GnuTLS support"),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
return 0;
}
#endif
if (config_proxy_use)
{
weechat_printf (server->buffer,
- _("%sirc: connecting to server %s:%d%s%s via %s "
+ _("%s%s: connecting to server %s:%d%s%s via %s "
"proxy %s:%d%s..."),
- weechat_prefix ("info"),
+ weechat_prefix ("info"), "irc",
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "",
@@ -2219,12 +2210,13 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
else
{
weechat_printf (server->buffer,
- _("%sirc: connecting to server %s:%d%s%s..."),
- weechat_prefix ("info"),
+ _("%s%s: connecting to server %s:%d%s%s..."),
+ weechat_prefix ("info"), "irc",
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
- weechat_log_printf (_("irc: connecting to server %s:%d%s%s..."),
+ weechat_log_printf (_("%s: connecting to server %s:%d%s%s..."),
+ "irc",
server->address, server->port,
(server->ipv6) ? " (IPv6)" : "",
(server->ssl) ? " (SSL)" : "");
@@ -2241,8 +2233,8 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
if (gnutls_init (&server->gnutls_sess, GNUTLS_CLIENT) != 0)
{
weechat_printf (server->buffer,
- _("%sirc: GnuTLS init error"),
- weechat_prefix ("error"));
+ _("%s%s: GnuTLS init error"),
+ weechat_prefix ("error"), "irc");
return 0;
}
gnutls_set_default_priority (server->gnutls_sess);
@@ -2259,8 +2251,8 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
if (pipe (child_pipe) < 0)
{
weechat_printf (server->buffer,
- _("%sirc: cannot create pipe"),
- weechat_prefix ("error"));
+ _("%s%s: cannot create pipe"),
+ weechat_prefix ("error"), "irc");
return 0;
}
server->child_read = child_pipe[0];
@@ -2274,8 +2266,8 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
if (server->sock == -1)
{
weechat_printf (server->buffer,
- _("%sirc: cannot create socket"),
- weechat_prefix ("error"));
+ _("%s%s: cannot create socket"),
+ weechat_prefix ("error"), "irc");
return 0;
}
@@ -2285,9 +2277,9 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
(void *) &set, sizeof (set)) == -1)
{
weechat_printf (server->buffer,
- _("%sirc: cannot set socket option "
+ _("%s%s: cannot set socket option "
"\"SO_REUSEADDR\""),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
/* set SO_KEEPALIVE option for socket */
@@ -2296,9 +2288,9 @@ irc_server_connect (struct t_irc_server *server, int disable_autojoin)
(void *) &set, sizeof (set)) == -1)
{
weechat_printf (server->buffer,
- _("%sirc: cannot set socket option "
+ _("%s%s: cannot set socket option "
"\"SO_KEEPALIVE\""),
- weechat_prefix ("error"));
+ weechat_prefix ("error"), "irc");
}
#ifdef __CYGWIN__
@@ -2343,8 +2335,8 @@ void
irc_server_reconnect (struct t_irc_server *server)
{
weechat_printf (server->buffer,
- _("%sirc: reconnecting to server..."),
- weechat_prefix ("info"));
+ _("%s%s: reconnecting to server..."),
+ weechat_prefix ("info"), "irc");
server->reconnect_start = 0;
if (irc_server_connect (server, 0))
@@ -2391,8 +2383,8 @@ irc_server_disconnect (struct t_irc_server *server, int reconnect)
{
//irc_nick_free_all (ptr_channel);
weechat_printf (ptr_channel->buffer,
- _("%sirc: disconnected from server!"),
- weechat_prefix ("info"));
+ _("%s%s: disconnected from server"),
+ weechat_prefix ("info"), "irc");
//gui_nicklist_draw (ptr_channel->buffer, 1, 1);
//gui_status_draw (ptr_channel->buffer, 1);
}
@@ -2402,8 +2394,8 @@ irc_server_disconnect (struct t_irc_server *server, int reconnect)
if (server->buffer)
weechat_printf (server->buffer,
- _("%sirc: disconnected from server!"),
- weechat_prefix ("info"));
+ _("%s%s: disconnected from server"),
+ weechat_prefix ("info"), "irc");
if (server->nick_modes)
{
diff --git a/src/plugins/logger/logger.c b/src/plugins/logger/logger.c
index c29ab1f8b..cfb1f77b8 100644
--- a/src/plugins/logger/logger.c
+++ b/src/plugins/logger/logger.c
@@ -262,8 +262,8 @@ logger_write_line (struct t_logger_buffer *logger_buffer, char *format, ...)
if (!logger_buffer->log_file)
{
weechat_printf (NULL,
- _("%sLogger: unable to write log file \"%s\"\n"),
- weechat_prefix ("error"),
+ _("%s%s: unable to write log file \"%s\""),
+ weechat_prefix ("error"), "Logger",
logger_buffer->log_filename);
free (logger_buffer->log_filename);
logger_buffer->log_filename = NULL;
diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c
index 278659024..418460f8a 100644
--- a/src/plugins/plugin-api.c
+++ b/src/plugins/plugin-api.c
@@ -323,12 +323,14 @@ plugin_api_info_get (struct t_weechat_plugin *plugin, char *info)
if (!plugin || !info)
return NULL;
- /* below are infos that do NOT need server to return info */
-
if (string_strcasecmp (info, "version") == 0)
{
return strdup (PACKAGE_VERSION);
}
+ if (string_strcasecmp (info, "date") == 0)
+ {
+ return strdup (__DATE__);
+ }
else if (string_strcasecmp (info, "dir_separator") == 0)
{
return strdup (DIR_SEPARATOR);
diff --git a/src/plugins/plugin.c b/src/plugins/plugin.c
index 330d1cbda..f976c4740 100644
--- a/src/plugins/plugin.c
+++ b/src/plugins/plugin.c
@@ -100,7 +100,7 @@ plugin_load (char *filename)
if (!handle)
{
gui_chat_printf (NULL,
- _("%sError: unable to load plugin \"%s\": %s\n"),
+ _("%sError: unable to load plugin \"%s\": %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
full_name, dlerror());
free (full_name);
@@ -114,7 +114,7 @@ plugin_load (char *filename)
dlclose (handle);
gui_chat_printf (NULL,
_("%sError: symbol \"%s\" not found in "
- "plugin \"%s\", failed to load\n"),
+ "plugin \"%s\", failed to load"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"plugin_name",
full_name);
@@ -128,7 +128,7 @@ plugin_load (char *filename)
dlclose (handle);
gui_chat_printf (NULL,
_("%sError: unable to load plugin \"%s\": a plugin "
- "with same name already exists\n"),
+ "with same name already exists"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
full_name);
free (full_name);
@@ -142,7 +142,7 @@ plugin_load (char *filename)
dlclose (handle);
gui_chat_printf (NULL,
_("%sError: symbol \"%s\" not found "
- "in plugin \"%s\", failed to load\n"),
+ "in plugin \"%s\", failed to load"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"plugin_description",
full_name);
@@ -157,7 +157,7 @@ plugin_load (char *filename)
dlclose (handle);
gui_chat_printf (NULL,
_("%sError: symbol \"%s\" not found in "
- "plugin \"%s\", failed to load\n"),
+ "plugin \"%s\", failed to load"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"plugin_version",
full_name);
@@ -175,7 +175,7 @@ plugin_load (char *filename)
dlclose (handle);
gui_chat_printf (NULL,
_("%sError: function \"%s\" not "
- "found in plugin \"%s\", failed to load\n"),
+ "found in plugin \"%s\", failed to load"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
"weechat_plugin_init",
full_name);
@@ -320,7 +320,7 @@ plugin_load (char *filename)
{
gui_chat_printf (NULL,
_("%sError: unable to initialize plugin "
- "\"%s\"\n"),
+ "\"%s\""),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
full_name);
plugin_remove (new_plugin);
@@ -332,7 +332,7 @@ plugin_load (char *filename)
{
gui_chat_printf (NULL,
_("%sError: unable to load plugin \"%s\" "
- "(not enough memory)\n"),
+ "(not enough memory)"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
full_name);
free (full_name);
@@ -340,7 +340,7 @@ plugin_load (char *filename)
}
gui_chat_printf (NULL,
- _("%sPlugin \"%s\" %s loaded.\n"),
+ _("%sPlugin \"%s\" %s loaded"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO],
name, new_plugin->version);
@@ -512,7 +512,7 @@ plugin_unload (struct t_weechat_plugin *plugin)
plugin_remove (plugin);
gui_chat_printf (NULL,
- _("%sPlugin \"%s\" unloaded.\n"),
+ _("%sPlugin \"%s\" unloaded"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO],
(name) ? name : "???");
if (name)
@@ -534,7 +534,7 @@ plugin_unload_name (char *name)
else
{
gui_chat_printf (NULL,
- _("%sError: plugin \"%s\" not found\n"),
+ _("%sError: plugin \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
name);
}
@@ -569,7 +569,7 @@ plugin_reload_name (char *name)
{
plugin_unload (ptr_plugin);
gui_chat_printf (NULL,
- _("%sPlugin \"%s\" unloaded.\n"),
+ _("%sPlugin \"%s\" unloaded"),
gui_chat_prefix[GUI_CHAT_PREFIX_INFO],
name);
plugin_load (filename);
@@ -579,7 +579,7 @@ plugin_reload_name (char *name)
else
{
gui_chat_printf (NULL,
- _("%sError: plugin \"%s\" not found\n"),
+ _("%sError: plugin \"%s\" not found"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
name);
}