From 19baa79d64dac93c6d1160e44b8daa8dd9a2b2d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Wed, 19 Apr 2023 16:34:50 +0200 Subject: [PATCH] core: convert deprecated commands bound to keys when upgrading weechat.conf to v2 --- po/cs.po | 7 ++++++- po/de.po | 7 ++++++- po/es.po | 7 ++++++- po/fr.po | 8 ++++++-- po/hu.po | 6 +++++- po/it.po | 7 ++++++- po/ja.po | 7 ++++++- po/pl.po | 7 ++++++- po/pt.po | 7 ++++++- po/pt_BR.po | 7 ++++++- po/ru.po | 6 +++++- po/sr.po | 7 ++++++- po/tr.po | 7 ++++++- po/weechat.pot | 6 +++++- src/core/wee-config.c | 36 +++++++++++++++++++++++++++++++++++- 15 files changed, 116 insertions(+), 16 deletions(-) diff --git a/po/cs.po b/po/cs.po index 52e9a1623..600d88c35 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -3144,6 +3144,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "příkaz pro klávesu: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "úroveň ladění pro plugin (\"core\" pro jádro WeeChat)" diff --git a/po/de.po b/po/de.po index cda396aef..e18fdbc59 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-04-13 20:09+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -4016,6 +4016,11 @@ msgstr "Veraltete Taste wurde entfernt: \"%s\"" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "Veraltete Taste konvertiert: \"%s\" => \"%s\"" +#, fuzzy, c-format +#| msgid "Alias converted to lower case: \"%s\" => \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Alias in Kleinbuchstaben umgewandelt: \"%s\" => \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "Debug-Level für Erweiterung (\"core\" für den WeeChat Core)" diff --git a/po/es.po b/po/es.po index 8385ce916..fa13e8f0d 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -3689,6 +3689,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Comando para el atajo: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "nivel de depurado para el plugin (\"core\" para el núcleo de WeeChat)" diff --git a/po/fr.po b/po/fr.po index afbc2d3ea..9cb3e7d92 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" -"PO-Revision-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" +"PO-Revision-Date: 2023-04-19 16:34+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -3923,6 +3923,10 @@ msgstr "Ancienne touche supprimée : \"%s\"" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "Ancienne touche convertie : \"%s\" => \"%s\"" +#, c-format +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Commande convertie pour la touche\"%s\" : \"%s\" => \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "niveau de debug pour l'extension (\"core\" pour le cœur de WeeChat)" diff --git a/po/hu.po b/po/hu.po index 38343a63d..680a132b6 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -2794,6 +2794,10 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, c-format +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" diff --git a/po/it.po b/po/it.po index ba8c0ce10..53d0c7b14 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -3302,6 +3302,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Comando per il tasto \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "livello di debug per il plugin (\"core\" per il core di WeeChat)" diff --git a/po/ja.po b/po/ja.po index e6e574b71..39b91000f 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "キーに対するコマンド: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "プラグイン (\"core\" は WeeChat コア) のデバッグレベル" diff --git a/po/pl.po b/po/pl.po index 64c694fc4..08510f66f 100644 --- a/po/pl.po +++ b/po/pl.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-04-13 20:09+0200\n" "Last-Translator: Krzysztof Korościk \n" "Language-Team: Polish \n" @@ -4248,6 +4248,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Komenda dla klawisza: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "poziom debugowania dla wtyczki (\"core\" dla rdzenia WeeChat)" diff --git a/po/pt.po b/po/pt.po index 86662ca71..7364d5311 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -3857,6 +3857,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Comando para a tecla: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "nível de depuração do plugin (\"core\" para o core WeeChat)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 8282a5834..90df1baab 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: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -3387,6 +3387,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Comando para tecla: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" "nível de debug para o plugin (\"core\" para o componente principal do " diff --git a/po/ru.po b/po/ru.po index 1888a4a00..cb2253c29 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -2816,6 +2816,10 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, c-format +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" diff --git a/po/sr.po b/po/sr.po index 991f89d7d..d16b7657d 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-04-13 20:10+0200\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -4233,6 +4233,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Команда за тастер: „%s”" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "дибаг ниво за додатак („core” за WeeChat језгро)" diff --git a/po/tr.po b/po/tr.po index 4114ab9ac..53ac0ed6e 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2023-03-25 21:13+0100\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -4287,6 +4287,11 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, fuzzy, c-format +#| msgid "Command for key: \"%s\"" +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "Düğme komutu: \"%s\"" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "eklenti hata ayıklama düzeyi (WeeChat çekirdeği için \"core\")" diff --git a/po/weechat.pot b/po/weechat.pot index 508169df3..1a7de2cfb 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: 2023-04-15 11:04+0200\n" +"POT-Creation-Date: 2023-04-19 14:56+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -2565,6 +2565,10 @@ msgstr "" msgid "Legacy key converted: \"%s\" => \"%s\"" msgstr "" +#, c-format +msgid "Command converted for key \"%s\": \"%s\" => \"%s\"" +msgstr "" + msgid "debug level for plugin (\"core\" for WeeChat core)" msgstr "" diff --git a/src/core/wee-config.c b/src/core/wee-config.c index fc512b520..87fdf749b 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -1524,8 +1524,27 @@ config_weechat_update_cb (const void *pointer, void *data, struct t_hashtable *data_read) { const char *ptr_section, *ptr_option, *ptr_value; + char *new_commands[][2] = { + /* old command, new command */ + { "/input jump_smart", "/buffer jump smart" }, + { "/input jump_last_buffer", "/buffer +" }, + { "/window ${_window_number};/input jump_last_buffer", "/window ${_window_number};/buffer +" }, + { "/input jump_last_buffer_displayed", "/buffer jump last_displayed" }, + { "/input jump_previously_visited_buffer", "/buffer jump prev_visited" }, + { "/input jump_next_visited_buffer", "/buffer jump next_visited" }, + { "/input hotlist_clear", "/hotlist clear" }, + { "/input hotlist_remove_buffer", "/hotlist remove" }, + { "/input hotlist_restore_buffer", "/hotlist restore" }, + { "/input hotlist_restore_all", "/hotlist restore -all" }, + { "/input set_unread_current_buffer", "/buffer set unread" }, + { "/input set_unread", "/allbuf /buffer set unread" }, + { "/input switch_active_buffer", "/buffer switch" }, + { "/input switch_active_buffer_previous", "/buffer switch -previous" }, + { "/input zoom_merged_buffer", "/buffer zoom" }, + { NULL, NULL }, + }; char *new_option; - int changes; + int changes, i; /* make C compiler happy */ (void) pointer; @@ -1594,6 +1613,21 @@ config_weechat_update_cb (const void *pointer, void *data, free (new_option); } } + for (i = 0; new_commands[i][0]; i++) + { + if (ptr_value && (strcmp (ptr_value, new_commands[i][0]) == 0)) + { + gui_chat_printf ( + NULL, + _("Command converted for key \"%s\": \"%s\" => \"%s\""), + hashtable_get (data_read, "option"), + new_commands[i][0], + new_commands[i][1]); + hashtable_set (data_read, "value", new_commands[i][1]); + changes++; + break; + } + } } }