From e4f181beb3279eef22a58f8e79c57264321cbd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 19 Mar 2023 17:42:12 +0100 Subject: core: display an error with `/bar add` when the bar already exists --- po/cs.po | 6 +++++- po/de.po | 7 ++++++- po/es.po | 6 +++++- po/fr.po | 8 ++++++-- po/hu.po | 6 +++++- po/it.po | 6 +++++- po/ja.po | 7 ++++++- po/pl.po | 7 ++++++- po/pt.po | 7 ++++++- po/pt_BR.po | 6 +++++- po/ru.po | 6 +++++- po/sr.po | 7 ++++++- po/tr.po | 7 ++++++- po/weechat.pot | 6 +++++- src/core/wee-command.c | 9 +++++++++ 15 files changed, 86 insertions(+), 15 deletions(-) diff --git a/po/cs.po b/po/cs.po index 93b5fca4b..c4a6e0df8 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -365,6 +365,10 @@ msgstr " %s (plugin: %s)" msgid "No bar item defined" msgstr "Žádné položky pole nejsou definovány" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%s%s: vzorec přesměrování \"%s\" již existuje" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sNedostatek paměti (%s)" diff --git a/po/de.po b/po/de.po index 2306ff7a3..ae0f0ff5b 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2023-02-01 11:05+0100\n" "Last-Translator: Nils Görs \n" "Language-Team: German - Germany \n" @@ -396,6 +396,11 @@ msgstr " %s (Erweiterung: %s)" msgid "No bar item defined" msgstr "Es wurde kein Bar-Item festgelegt" +#, fuzzy, c-format +#| msgid "%sAlias \"%s\" already exists" +msgid "%sBar \"%s\" already exists" +msgstr "%sAlias \"%s\" existiert bereits" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sNicht ausreichend Speicher (%s)" diff --git a/po/es.po b/po/es.po index 3e3cb0992..9d998f7f2 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -416,6 +416,10 @@ msgstr " %s (plugin: %s)" msgid "No bar item defined" msgstr "Ningún elemento definido" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%sError: el filtro \"%s\" ya existe" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sNo hay suficiente memoria (%s)" diff --git a/po/fr.po b/po/fr.po index b616ea1c6..b7a7e3210 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-03-19 07:53+0100\n" -"PO-Revision-Date: 2023-03-19 07:57+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" +"PO-Revision-Date: 2023-03-19 17:41+0100\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -381,6 +381,10 @@ msgstr " %s (extension : %s)" msgid "No bar item defined" msgstr "Pas d'objet de barre défini" +#, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%sLa barre \"%s\" existe déjà" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sPas assez de mémoire (%s)" diff --git a/po/hu.po b/po/hu.po index be0daff1b..25d28bcd9 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -343,6 +343,10 @@ msgstr " (nem található bővítőmodul)\n" msgid "No bar item defined" msgstr "Nincs aliasz definiálva.\n" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%s az ignore már létezik\n" + #, fuzzy, c-format msgid "%sNot enough memory (%s)" msgstr "Nincs elég memória az új sorhoz\n" diff --git a/po/it.po b/po/it.po index 8546f35fa..769765299 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -341,6 +341,10 @@ msgstr " %s (plugin: %s)" msgid "No bar item defined" msgstr "Nessun elemento barra definito" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%sErrore: il filtro \"%s\" esiste già" + #, fuzzy, c-format msgid "%sNot enough memory (%s)" msgstr "%sSpazio non sufficiente" diff --git a/po/ja.po b/po/ja.po index cb2ffa7e5..05d5d32b8 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: Polish \n" @@ -382,6 +382,11 @@ msgstr " %s (wtyczka: %s)" msgid "No bar item defined" msgstr "Nie zdefiniowano elementów paska" +#, fuzzy, c-format +#| msgid "%s%s: trigger \"%s\" already exists" +msgid "%sBar \"%s\" already exists" +msgstr "%s%s: trigger \"%s\" już istnieje" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sZa mało pamięci (%s)" diff --git a/po/pt.po b/po/pt.po index cd4c6e151..9f2c4c2d3 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -366,6 +366,11 @@ msgstr " %s (plugin: %s)" msgid "No bar item defined" msgstr "Nenhum item de barra definido" +#, fuzzy, c-format +#| msgid "%s%s: trigger \"%s\" already exists" +msgid "%sBar \"%s\" already exists" +msgstr "%s%s: o acionador \"%s\" já existe" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sMemória insuficiente (%s)" diff --git a/po/pt_BR.po b/po/pt_BR.po index 72f6197cf..708859fd5 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -373,6 +373,10 @@ msgstr " %s (plugin: %s)" msgid "No bar item defined" msgstr "Nenhum item da barra definido" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%sErro: filtro \"%s\" já existe" + #, fuzzy, c-format msgid "%sNot enough memory (%s)" msgstr "%sMemória insuficiente" diff --git a/po/ru.po b/po/ru.po index ba0ecf1b3..595a62f12 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -352,6 +352,10 @@ msgstr " (нет pluginа)\n" msgid "No bar item defined" msgstr "Сокращения не заданы.\n" +#, fuzzy, c-format +msgid "%sBar \"%s\" already exists" +msgstr "%s игнорирование уже существует\n" + #, fuzzy, c-format msgid "%sNot enough memory (%s)" msgstr "Недостаточно памяти для новой строчки\n" diff --git a/po/sr.po b/po/sr.po index b2d31a510..b2656cf96 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2023-02-01 14:25+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -379,6 +379,11 @@ msgstr " %s (додатак: %s)" msgid "No bar item defined" msgstr "Није дефинисана ниједна ставка траке" +#, fuzzy, c-format +#| msgid "%sAlias \"%s\" already exists" +msgid "%sBar \"%s\" already exists" +msgstr "%sАлијас „%s” већ постоји" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sНема довољно меморије (%s)" diff --git a/po/tr.po b/po/tr.po index a59cf2cbd..3f91d7549 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2022-10-15 22:51+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -379,6 +379,11 @@ msgstr " %s (eklenti: %s)" msgid "No bar item defined" msgstr "Çubuk ögesi tanımlanmamış" +#, fuzzy, c-format +#| msgid "%s%s: trigger \"%s\" already exists" +msgid "%sBar \"%s\" already exists" +msgstr "%s%s: \"%s\" tetiği halihazırda mevcut" + #, c-format msgid "%sNot enough memory (%s)" msgstr "%sBellek yetersiz (%s)" diff --git a/po/weechat.pot b/po/weechat.pot index 5c37fee92..ee27b2be8 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-03-19 07:53+0100\n" +"POT-Creation-Date: 2023-03-19 17:41+0100\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -306,6 +306,10 @@ msgstr "" msgid "No bar item defined" msgstr "" +#, c-format +msgid "%sBar \"%s\" already exists" +msgstr "" + #, c-format msgid "%sNot enough memory (%s)" msgstr "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index d1e3ec953..a79faefc0 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -277,6 +277,15 @@ COMMAND_CALLBACK(bar) if (string_strcmp (argv[1], "add") == 0) { COMMAND_MIN_ARGS(8, "add"); + ptr_bar = gui_bar_search (argv[2]); + if (ptr_bar) + { + gui_chat_printf (NULL, + _("%sBar \"%s\" already exists"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + argv[2]); + return WEECHAT_RC_OK; + } pos_condition = strchr (argv[3], ','); if (pos_condition) { -- cgit v1.2.3