diff options
-rw-r--r-- | ChangeLog.asciidoc | 1 | ||||
-rw-r--r-- | po/cs.po | 8 | ||||
-rw-r--r-- | po/de.po | 8 | ||||
-rw-r--r-- | po/es.po | 8 | ||||
-rw-r--r-- | po/fr.po | 12 | ||||
-rw-r--r-- | po/hu.po | 8 | ||||
-rw-r--r-- | po/it.po | 8 | ||||
-rw-r--r-- | po/ja.po | 8 | ||||
-rw-r--r-- | po/pl.po | 8 | ||||
-rw-r--r-- | po/pt_BR.po | 8 | ||||
-rw-r--r-- | po/ru.po | 8 | ||||
-rw-r--r-- | po/tr.po | 8 | ||||
-rw-r--r-- | po/weechat.pot | 8 | ||||
-rw-r--r-- | src/core/weechat.c | 22 |
14 files changed, 109 insertions, 14 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 77cb2c32b..706609465 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -19,6 +19,7 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: display a warning on startup if the locale can not be set (closes #373) * core: allow "*" as plugin name in command /plugin reload to reload all plugins with options * core: add option "-s" in command /eval to split expression before evaluating @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -202,6 +202,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Obdržen signál %s, ukončuji WeeChat..." @@ -24,7 +24,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-26 22:58+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <>\n" @@ -210,6 +210,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "%sEs sollte folgende Zeile in Datei %s eingefügt werden: %s" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Signal %s empfangen, beende WeeChat..." @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -208,6 +208,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Señal %s recibida, cerrando WeeChat..." @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" -"PO-Revision-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" +"PO-Revision-Date: 2015-03-30 19:14+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -201,6 +201,14 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "%sVous devriez ajouter cette ligne dans le fichier %s: %s" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" +"%sAttention : impossible de définir la locale ; vérifiez que les variables " +"$LANG et $LC_* sont correctes" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Signal %s reçu, sortie de WeeChat..." @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -203,6 +203,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -199,6 +199,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Ricevuto segnale %s, chiusura di WeeChat..." @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-23 22:34+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n" @@ -198,6 +198,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "%sファイル %s にこの行を追加してください: %s" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "シグナル %s を受け取りました、WeeChat の終了中..." @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -200,6 +200,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "%sPowinieneś dodać tą linię w pliku %s: %s" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Otrzymano sygnał %s, wychodzę z WeeChat..." diff --git a/po/pt_BR.po b/po/pt_BR.po index 6250c1682..b82be378f 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Eduardo Elias <camponez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -231,6 +231,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "Sinal %s recebido, saindo do WeeChat..." @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-21 08:41+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -212,6 +212,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2015-03-10 21:33+0100\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -174,6 +174,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "" diff --git a/po/weechat.pot b/po/weechat.pot index ec16df120..3e1427eea 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2015-03-24 06:54+0100\n" +"POT-Creation-Date: 2015-03-30 19:14+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -171,6 +171,12 @@ msgid "%sYou should add this line in the file %s: %s" msgstr "" #, c-format +msgid "" +"%sWarning: cannot set the locale; make sure $LANG and $LC_* variables are " +"correct" +msgstr "" + +#, c-format msgid "Signal %s received, exiting WeeChat..." msgstr "" diff --git a/src/core/weechat.c b/src/core/weechat.c index fd387b30c..ffdab2511 100644 --- a/src/core/weechat.c +++ b/src/core/weechat.c @@ -89,6 +89,7 @@ struct timeval weechat_current_start_timeval; /* start time used to display */ int weechat_quit = 0; /* = 1 if quit request from user */ int weechat_sigsegv = 0; /* SIGSEGV received? */ char *weechat_home = NULL; /* home dir. (default: ~/.weechat) */ +int weechat_locale_ok = 0; /* is locale OK? */ char *weechat_local_charset = NULL; /* example: ISO-8859-1, UTF-8 */ int weechat_server_cmd_line = 0; /* at least 1 server on cmd line */ int weechat_auto_load_plugins = 1; /* auto load plugins */ @@ -429,6 +430,24 @@ weechat_term_check () } /* + * Displays warning about wrong locale ($LANG and $LC_*) if they are detected + * as wrong. + */ + +void +weechat_locale_check () +{ + if (!weechat_locale_ok) + { + gui_chat_printf ( + NULL, + _("%sWarning: cannot set the locale; make sure $LANG and $LC_* " + "variables are correct"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR]); + } +} + +/* * Callback for system signal SIGHUP: quits WeeChat. */ @@ -501,7 +520,7 @@ weechat_init (int argc, char *argv[], void (*gui_init_cb)()) weechat_first_start_time = time (NULL); /* initialize start time */ gettimeofday (&weechat_current_start_timeval, NULL); - setlocale (LC_ALL, ""); /* initialize gettext */ + weechat_locale_ok = (setlocale (LC_ALL, "") != NULL); /* init gettext */ #ifdef ENABLE_NLS bindtextdomain (PACKAGE, LOCALEDIR); bind_textdomain_codeset (PACKAGE, "UTF-8"); @@ -556,6 +575,7 @@ weechat_init (int argc, char *argv[], void (*gui_init_cb)()) weechat_welcome_message (); /* display WeeChat welcome message */ gui_chat_print_lines_waiting_buffer (NULL); /* display lines waiting */ weechat_term_check (); /* warnings about $TERM (if wrong) */ + weechat_locale_check (); /* warning about wrong locale */ command_startup (0); /* command executed before plugins */ plugin_init (weechat_auto_load_plugins, /* init plugin interface(s) */ argc, argv); |