summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/common.h1
-rw-r--r--src/core/args.c10
-rw-r--r--src/core/net-disconnect.c4
-rw-r--r--src/core/network.c8
-rw-r--r--src/core/settings.c33
-rw-r--r--src/fe-common/core/fe-common-core.c12
-rw-r--r--src/fe-common/core/fe-settings.c15
-rw-r--r--src/fe-common/core/module-formats.c1
-rw-r--r--src/fe-common/core/module-formats.h3
-rw-r--r--src/fe-common/core/printtext.c4
-rw-r--r--src/fe-common/core/themes.c2
-rw-r--r--src/fe-common/irc/fe-irc-commands.c8
-rw-r--r--src/fe-common/irc/module-formats.c1
-rw-r--r--src/fe-common/irc/module-formats.h3
-rw-r--r--src/fe-text/irssi.c2
-rw-r--r--src/lib-popt/popthelp.c4
-rw-r--r--src/nls.h24
18 files changed, 59 insertions, 77 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 80d33cd4..0288811f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -11,7 +11,6 @@ PERLDIR=perl
endif
noinst_HEADERS = \
- nls.h \
common.h
SUBDIRS = lib-popt lib-config core irc fe-common $(PERLDIR) $(TEXTUI) $(BOTUI)
diff --git a/src/common.h b/src/common.h
index d97736aa..c79c5d9b 100644
--- a/src/common.h
+++ b/src/common.h
@@ -44,7 +44,6 @@
#endif
#include "core/memdebug.h"
-#include "nls.h"
#define g_free_not_null(a) \
G_STMT_START { \
diff --git a/src/core/args.c b/src/core/args.c
index 9359b7b5..093a8d56 100644
--- a/src/core/args.c
+++ b/src/core/args.c
@@ -52,12 +52,10 @@ void args_execute(int argc, char *argv[])
while ((nextopt = poptGetNextOpt(con)) > 0) ;
if (nextopt != -1) {
- printf(_("Error on option %s: %s.\n"
- "Run '%s --help' to see a full list of "
- "available command line options.\n"),
- poptBadOption(con, 0),
- poptStrerror(nextopt),
- argv[0]);
+ printf("Error on option %s: %s.\n"
+ "Run '%s --help' to see a full list of "
+ "available command line options.\n",
+ poptBadOption(con, 0), poptStrerror(nextopt), argv[0]);
exit(1);
}
diff --git a/src/core/net-disconnect.c b/src/core/net-disconnect.c
index 9f477fb5..b0e9535b 100644
--- a/src/core/net-disconnect.c
+++ b/src/core/net-disconnect.c
@@ -147,8 +147,8 @@ void net_disconnect_deinit(void)
} else if (first) {
/* Display the text when we have already waited
for a while */
- printf(_("Please wait, waiting for servers to close "
- "connections..\n"));
+ printf("Please wait, waiting for servers to close "
+ "connections..\n");
fflush(stdout);
first = 0;
diff --git a/src/core/network.c b/src/core/network.c
index 5315d063..4fc06c05 100644
--- a/src/core/network.c
+++ b/src/core/network.c
@@ -540,13 +540,13 @@ const char *net_gethosterror(int error)
#else
switch (error) {
case HOST_NOT_FOUND:
- return _("Host not found");
+ return "Host not found";
case NO_ADDRESS:
- return _("No IP address found for name");
+ return "No IP address found for name";
case NO_RECOVERY:
- return _("A non-recovable name server error occurred");
+ return "A non-recovable name server error occurred";
case TRY_AGAIN:
- return _("A temporary error on an authoritative name server");
+ return "A temporary error on an authoritative name server";
}
/* unknown error */
diff --git a/src/core/settings.c b/src/core/settings.c
index 5c8d17d2..0169b268 100644
--- a/src/core/settings.c
+++ b/src/core/settings.c
@@ -367,8 +367,8 @@ void settings_check_module(const char *module)
if (node == NULL) return;
errors = g_string_new(NULL);
- g_string_sprintf(errors, _("Unknown settings in configuration "
- "file for module %s:"), module);
+ g_string_sprintf(errors, "Unknown settings in configuration "
+ "file for module %s:", module);
count = 0;
for (tmp = node->value; tmp != NULL; tmp = tmp->next) {
@@ -511,7 +511,7 @@ static CONFIG_REC *parse_configfile(const char *fname)
config = config_open(path, -1);
if (config == NULL) {
last_config_error_msg =
- g_strdup_printf(_("Error opening configuration file %s: %s"),
+ g_strdup_printf("Error opening configuration file %s: %s",
path, g_strerror(errno));
config = config_open(NULL, -1);
}
@@ -536,12 +536,11 @@ static void init_configfile(void)
if (stat(str, &statbuf) != 0) {
/* ~/.irssi not found, create it. */
if (mkpath(str, 0700) != 0) {
- g_error(_("Couldn't create %s directory"), str);
+ g_error("Couldn't create %s directory", str);
}
} else if (!S_ISDIR(statbuf.st_mode)) {
- g_error(_("%s is not a directory.\n"
- "You should remove it with command: rm ~/.irssi"),
- str);
+ g_error("%s is not a directory.\n"
+ "You should remove it with command: rm ~/.irssi", str);
}
g_free(str);
@@ -551,8 +550,8 @@ static void init_configfile(void)
/* any errors? */
if (config_last_error(mainconfig) != NULL) {
last_config_error_msg =
- g_strdup_printf(_("Ignored errors in configuration "
- "file:\n%s"),
+ g_strdup_printf("Ignored errors in configuration "
+ "file:\n%s",
config_last_error(mainconfig));
}
@@ -576,7 +575,7 @@ int settings_reread(const char *fname)
}
if (config_last_error(tempconfig) != NULL) {
- str = g_strdup_printf(_("Errors in configuration file:\n%s"),
+ str = g_strdup_printf("Errors in configuration file:\n%s",
config_last_error(tempconfig));
signal_emit("gui dialog", 2, "error", str);
g_free(str);
@@ -606,8 +605,7 @@ int settings_save(const char *fname)
irssi_config_save_state(fname);
config_last_modifycounter = mainconfig->modifycounter;
if (error) {
- str = g_strdup_printf(_("Couldn't save "
- "configuration file: %s"),
+ str = g_strdup_printf("Couldn't save configuration file: %s",
config_last_error(mainconfig));
signal_emit("gui dialog", 2, "error", str);
g_free(str);
@@ -627,12 +625,11 @@ static void sig_autosave(void)
settings_save(NULL);
else {
fname = g_strconcat(mainconfig->fname, ".autosave", NULL);
- str = g_strdup_printf(_("Configuration file was modified "
- "while irssi was running. Saving "
- "configuration to file '%s' instead. "
- "Use /SAVE or /RELOAD to get rid of "
- "this message."),
- fname);
+ str = g_strdup_printf("Configuration file was modified "
+ "while irssi was running. Saving "
+ "configuration to file '%s' instead. "
+ "Use /SAVE or /RELOAD to get rid of "
+ "this message.", fname);
signal_emit("gui dialog", 2, "warning", str);
g_free(str);
diff --git a/src/fe-common/core/fe-common-core.c b/src/fe-common/core/fe-common-core.c
index dba05b06..8cfb3a85 100644
--- a/src/fe-common/core/fe-common-core.c
+++ b/src/fe-common/core/fe-common-core.c
@@ -119,12 +119,12 @@ static void sig_channel_destroyed(CHANNEL_REC *channel)
void fe_common_core_init(void)
{
static struct poptOption options[] = {
- { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, N_("Automatically connect to server/ircnet"), N_("SERVER") },
- { "password", 'w', POPT_ARG_STRING, &autocon_password, 0, N_("Autoconnect password"), N_("SERVER") },
- { "port", 'p', POPT_ARG_INT, &autocon_port, 0, N_("Autoconnect port"), N_("PORT") },
- { "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, N_("Disable autoconnecting"), NULL },
- { "nick", 'n', POPT_ARG_STRING, &cmdline_nick, 0, N_("Specify nick to use"), NULL },
- { "hostname", 'h', POPT_ARG_STRING, &cmdline_hostname, 0, N_("Specify host name to use"), NULL },
+ { "connect", 'c', POPT_ARG_STRING, &autocon_server, 0, "Automatically connect to server/ircnet", "SERVER" },
+ { "password", 'w', POPT_ARG_STRING, &autocon_password, 0, "Autoconnect password", "SERVER" },
+ { "port", 'p', POPT_ARG_INT, &autocon_port, 0, "Autoconnect port", "PORT" },
+ { "noconnect", '!', POPT_ARG_NONE, &no_autoconnect, 0, "Disable autoconnecting", NULL },
+ { "nick", 'n', POPT_ARG_STRING, &cmdline_nick, 0, "Specify nick to use", NULL },
+ { "hostname", 'h', POPT_ARG_STRING, &cmdline_hostname, 0, "Specify host name to use", NULL },
{ NULL, '\0', 0, NULL }
};
diff --git a/src/fe-common/core/fe-settings.c b/src/fe-common/core/fe-settings.c
index cb12e2d3..90262ee0 100644
--- a/src/fe-common/core/fe-settings.c
+++ b/src/fe-common/core/fe-settings.c
@@ -262,7 +262,7 @@ static void settings_save_fe(const char *fname)
static void settings_save_confirm(const char *line, char *fname)
{
- if (g_strncasecmp(line, _("Y"), 1) == 0)
+ if (line[0] == 'Y')
settings_save_fe(fname);
g_free(fname);
}
@@ -270,6 +270,8 @@ static void settings_save_confirm(const char *line, char *fname)
/* SYNTAX: SAVE [<file>] */
static void cmd_save(const char *data)
{
+ char *format;
+
if (*data == '\0')
data = mainconfig->fname;
@@ -280,14 +282,17 @@ static void cmd_save(const char *data)
printformat(NULL, NULL, MSGLEVEL_CLIENTNOTICE,
TXT_CONFIG_MODIFIED, data);
+
+ format = format_get_text(MODULE_NAME, NULL, NULL, NULL,
+ TXT_OVERWRITE_CONFIG);
keyboard_entry_redirect((SIGNAL_FUNC) settings_save_confirm,
- _("Overwrite config (y/N)?"),
- 0, g_strdup(data));
+ format, 0, g_strdup(data));
+ g_free(format);
}
static void settings_clean_confirm(const char *line)
{
- if (g_strncasecmp(line, _("Y"), 1) == 0)
+ if (line[0] == 'Y')
settings_clean_invalid();
}
@@ -295,7 +300,7 @@ static void sig_settings_errors(const char *msg)
{
printtext(NULL, NULL, MSGLEVEL_CLIENTERROR, "%s", msg);
keyboard_entry_redirect((SIGNAL_FUNC) settings_clean_confirm,
- _("Remove unknown settings from config file (Y/n)?"),
+ "Remove unknown settings from config file (Y/n)?",
0, NULL);
}
diff --git a/src/fe-common/core/module-formats.c b/src/fe-common/core/module-formats.c
index a25e8e01..9ccdd10a 100644
--- a/src/fe-common/core/module-formats.c
+++ b/src/fe-common/core/module-formats.c
@@ -222,6 +222,7 @@ FORMAT_REC fecommon_core_formats[] = {
{ "config_reloaded", "Reloaded configuration", 1, { 0 } },
{ "config_modified", "Configuration file was modified since irssi was last started - do you want to overwrite the possible changes?", 1, { 0 } },
{ "glib_error", "{error GLib $0} $1", 2, { 0, 0 } },
+ { "overwrite_config", "Overwrite config (y/N)?", 0 },
{ NULL, NULL, 0 }
};
diff --git a/src/fe-common/core/module-formats.h b/src/fe-common/core/module-formats.h
index 1818041c..e0f31f9a 100644
--- a/src/fe-common/core/module-formats.h
+++ b/src/fe-common/core/module-formats.h
@@ -187,7 +187,8 @@ enum {
TXT_CONFIG_SAVED,
TXT_CONFIG_RELOADED,
TXT_CONFIG_MODIFIED,
- TXT_GLIB_ERROR
+ TXT_GLIB_ERROR,
+ TXT_OVERWRITE_CONFIG
};
extern FORMAT_REC fecommon_core_formats[];
diff --git a/src/fe-common/core/printtext.c b/src/fe-common/core/printtext.c
index ab1eafcd..38de158d 100644
--- a/src/fe-common/core/printtext.c
+++ b/src/fe-common/core/printtext.c
@@ -414,9 +414,9 @@ static void sig_gui_dialog(const char *type, const char *text)
char *format;
if (g_strcasecmp(type, "warning") == 0)
- format = _("%_Warning:%_ %s");
+ format = "%_Warning:%_ %s";
else if (g_strcasecmp(type, "error") == 0)
- format = _("%_Error:%_ %s");
+ format = "%_Error:%_ %s";
else
format = "%s";
diff --git a/src/fe-common/core/themes.c b/src/fe-common/core/themes.c
index ac077d9d..de9b6dee 100644
--- a/src/fe-common/core/themes.c
+++ b/src/fe-common/core/themes.c
@@ -788,7 +788,7 @@ static int theme_read(THEME_REC *theme, const char *path, const char *data)
config_parse(config);
if (config_last_error(config) != NULL) {
- str = g_strdup_printf(_("Ignored errors in theme %s:\n%s"),
+ str = g_strdup_printf("Ignored errors in theme %s:\n%s",
theme->name, config_last_error(config));
read_error(str);
g_free(str);
diff --git a/src/fe-common/irc/fe-irc-commands.c b/src/fe-common/irc/fe-irc-commands.c
index 49d5e917..a2e4829c 100644
--- a/src/fe-common/irc/fe-irc-commands.c
+++ b/src/fe-common/irc/fe-irc-commands.c
@@ -396,7 +396,7 @@ static void cmd_oper_got_pass(const char *password, OPER_PASS_REC *rec)
/* SYNTAX: OPER [<nick> [<password>]] */
static void cmd_oper(const char *data, IRC_SERVER_REC *server)
{
- char *nick, *password;
+ char *nick, *password, *format;
void *free_arg;
g_return_if_fail(data != NULL);
@@ -414,9 +414,13 @@ static void cmd_oper(const char *data, IRC_SERVER_REC *server)
rec->server = server;
rec->nick = g_strdup(*nick != '\0' ? nick : server->nick);
+ format = format_get_text(MODULE_NAME, NULL, server, NULL,
+ IRCTXT_ASK_OPER_PASS);
+
keyboard_entry_redirect((SIGNAL_FUNC) cmd_oper_got_pass,
- _("Operator password:"),
+ format,
ENTRY_REDIRECT_FLAG_HIDDEN, rec);
+ g_free(format);
signal_stop();
}
diff --git a/src/fe-common/irc/module-formats.c b/src/fe-common/irc/module-formats.c
index a99caf67..cae4bd85 100644
--- a/src/fe-common/irc/module-formats.c
+++ b/src/fe-common/irc/module-formats.c
@@ -161,6 +161,7 @@ FORMAT_REC fecommon_irc_formats[] = {
{ "silenced", "Silenced {nick $0}", 1, { 0 } },
{ "unsilenced", "Unsilenced {nick $0}", 1, { 0 } },
{ "silence_line", "{nick $0}: silence {ban $1}", 2, { 0, 0 } },
+ { "ask_oper_pass", "Operator password:", 0 },
{ NULL, NULL, 0 }
};
diff --git a/src/fe-common/irc/module-formats.h b/src/fe-common/irc/module-formats.h
index fc33dba1..e8ee34ca 100644
--- a/src/fe-common/irc/module-formats.h
+++ b/src/fe-common/irc/module-formats.h
@@ -130,7 +130,8 @@ enum {
IRCTXT_SILENCED,
IRCTXT_UNSILENCED,
- IRCTXT_SILENCE_LINE
+ IRCTXT_SILENCE_LINE,
+ IRCTXT_ASK_OPER_PASS
};
extern FORMAT_REC fecommon_irc_formats[];
diff --git a/src/fe-text/irssi.c b/src/fe-text/irssi.c
index dfae17c5..55b576fb 100644
--- a/src/fe-text/irssi.c
+++ b/src/fe-text/irssi.c
@@ -282,7 +282,7 @@ int main(int argc, char **argv)
args_execute(argc, argv);
if (!init_screen())
- g_error(_("Can't initialize screen handling, quitting.\n"));
+ g_error("Can't initialize screen handling, quitting.\n");
textui_finish_init();
main_loop = g_main_new(TRUE);
diff --git a/src/lib-popt/popthelp.c b/src/lib-popt/popthelp.c
index 493726e0..c1876d74 100644
--- a/src/lib-popt/popthelp.c
+++ b/src/lib-popt/popthelp.c
@@ -21,8 +21,8 @@ static void displayArgs(poptContext con, enum poptCallbackReason foo,
struct poptOption poptHelpOptions[] = {
{ NULL, '\0', POPT_ARG_CALLBACK, (void *)&displayArgs, '\0', NULL },
- { "help", '?', 0, NULL, '?', N_("Show this help message") },
- { "usage", '\0', 0, NULL, 'u', N_("Display brief usage message") },
+ { "help", '?', 0, NULL, '?', "Show this help message" },
+ { "usage", '\0', 0, NULL, 'u', "Display brief usage message" },
{ NULL, '\0', 0, NULL, 0 }
} ;
diff --git a/src/nls.h b/src/nls.h
deleted file mode 100644
index d8148620..00000000
--- a/src/nls.h
+++ /dev/null
@@ -1,24 +0,0 @@
-#ifdef ENABLE_NLS
-
-# ifdef HAVE_LIBINTL_H
-# include <libintl.h>
-# else
-# include "../intl/libgettext.h"
-# endif
-
-# define _(String) gettext (String)
-# ifdef gettext_noop
-# define N_(String) gettext_noop (String)
-# else
-# define N_(String) (String)
-# endif
-#else
-/* Stubs that do something close enough. */
-# define textdomain(String) (String)
-# define gettext(String) (String)
-# define dgettext(Domain,Message) (Message)
-# define dcgettext(Domain,Message,Type) (Message)
-# define bindtextdomain(Domain,Directory) (Domain)
-# define _(String) (String)
-# define N_(String) (String)
-#endif