summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSébastien Helleu <flashcode@flashtux.org>2023-01-30 22:09:36 +0100
committerSébastien Helleu <flashcode@flashtux.org>2023-01-30 22:09:36 +0100
commite78d96686c6146d969d96431cdd117da945072e5 (patch)
tree86880b61bc09e940c754930a4a308404bd999187
parent4370f75ce6755a928908c14f3f3028515135cb72 (diff)
downloadweechat-e78d96686c6146d969d96431cdd117da945072e5.zip
core: inform that commands are case sensitive when another command with different case is found (issue #1877)
-rw-r--r--po/cs.po8
-rw-r--r--po/de.po9
-rw-r--r--po/es.po8
-rw-r--r--po/fr.po12
-rw-r--r--po/hu.po8
-rw-r--r--po/it.po8
-rw-r--r--po/ja.po8
-rw-r--r--po/pl.po9
-rw-r--r--po/pt.po8
-rw-r--r--po/pt_BR.po8
-rw-r--r--po/ru.po8
-rw-r--r--po/sr.po9
-rw-r--r--po/tr.po9
-rw-r--r--po/weechat.pot8
-rw-r--r--src/core/hook/wee-hook-command.c11
-rw-r--r--src/core/hook/wee-hook-command.h3
16 files changed, 117 insertions, 17 deletions
diff --git a/po/cs.po b/po/cs.po
index d7b5fb5c5..b992b44f4 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -149,6 +149,12 @@ msgstr "%sChyba: příkaz \"%s\" již existuje pro plugin \"%s\""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sChyba: neznámý příkaz \"%s\" (napište /help pro nápovědu)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sChyba: neznámý příkaz \"%s\" (napište /help pro nápovědu)"
diff --git a/po/de.po b/po/de.po
index 196c18459..705eda43f 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2023-01-29 13:05+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German - Germany <weechatter@arcor.de>\n"
@@ -150,6 +150,13 @@ msgstr ""
#, fuzzy, c-format
#| msgid "%sUnknown command \"%s\" (type /help for help)"
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sDer Befehl \"%s\" ist nicht bekannt (für eine Hilfe nutze /help)"
+
+#, fuzzy, c-format
+#| msgid "%sUnknown command \"%s\" (type /help for help)"
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sDer Befehl \"%s\" ist nicht bekannt (für eine Hilfe nutze /help)"
diff --git a/po/es.po b/po/es.po
index d27dda2d6..a16c23354 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -147,6 +147,12 @@ msgstr "%sError: el comando \"%s\" ya existe en el plugin \"%s\""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sError: comando \"%s\" desconocido (use /help para ver la ayuda)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sError: comando \"%s\" desconocido (use /help para ver la ayuda)"
diff --git a/po/fr.po b/po/fr.po
index 50480ce25..e684acbb0 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-01-30 21:30+0100\n"
-"PO-Revision-Date: 2023-01-30 21:32+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
+"PO-Revision-Date: 2023-01-30 22:07+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -141,6 +141,14 @@ msgstr "%sUne autre commande \"%s\" existe déjà pour l'extension \"%s\""
#, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr ""
+"%sCommande \"%s\" inconnue (les commandes sont sensibles à la casse, tapez /"
+"help pour l'aide), commandes avec un nom similaire : %s"
+
+#, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr ""
diff --git a/po/hu.po b/po/hu.po
index a7cb0f87e..27f96c3b3 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -149,6 +149,12 @@ msgstr "%s az ignore már létezik\n"
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%s a \"%s\" aliasz vagy parancs nem található\n"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%s a \"%s\" aliasz vagy parancs nem található\n"
diff --git a/po/it.po b/po/it.po
index 3d9979ded..d88a7e262 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -146,6 +146,12 @@ msgstr "%sErrore: un altro comando \"%s\" esiste già per il plugin \"%s\""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sErrore: comando \"%s\" sconosciuto (digita /help per l'aiuto)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sErrore: comando \"%s\" sconosciuto (digita /help per l'aiuto)"
diff --git a/po/ja.po b/po/ja.po
index f5eed819a..6bf471ff2 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -147,6 +147,12 @@ msgstr ""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sエラー: 未定義のコマンド \"%s\" (ヘルプを見るには /help を入力)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sエラー: 未定義のコマンド \"%s\" (ヘルプを見るには /help を入力)"
diff --git a/po/pl.po b/po/pl.po
index 2ea6787c0..c0f6ca63d 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-12-30 14:10+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -144,6 +144,13 @@ msgstr "%sIstnieje już inna komenda \"%s\" dla wtyczki \"%s\""
#, fuzzy, c-format
#| msgid "%sUnknown command \"%s\" (type /help for help)"
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sNieznana komenda \"%s\" (wpisz /help , aby uzyskać pomoc)"
+
+#, fuzzy, c-format
+#| msgid "%sUnknown command \"%s\" (type /help for help)"
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sNieznana komenda \"%s\" (wpisz /help , aby uzyskać pomoc)"
diff --git a/po/pt.po b/po/pt.po
index cd3c556bc..f5576b79d 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -148,6 +148,12 @@ msgstr "%sErro: outro comando \"%s\" já existe para o plugin \"%s\""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sErro: comando desconhecido: \"%s\" (escreva /help para obter ajuda)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sErro: comando desconhecido: \"%s\" (escreva /help para obter ajuda)"
diff --git a/po/pt_BR.po b/po/pt_BR.po
index 4f3f8da3e..74b778984 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -145,6 +145,12 @@ msgstr "%sOutro comando \"%s\" já existe para o plugin \"%s\""
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sErro com o comando \"%s\" (ajuda no comando: /help %s)"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sErro com o comando \"%s\" (ajuda no comando: /help %s)"
diff --git a/po/ru.po b/po/ru.po
index bad808969..c32738542 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -157,6 +157,12 @@ msgstr "%s игнорирование уже существует\n"
#, fuzzy, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%s сокращение или команда \"%s\" не найдены\n"
+
+#, fuzzy, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%s сокращение или команда \"%s\" не найдены\n"
diff --git a/po/sr.po b/po/sr.po
index e7373fdab..3fab1c192 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-12-05 09:44+0400\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -147,6 +147,13 @@ msgstr "%sВећ постоји друга команда \"%s\" за додат
#, fuzzy, c-format
#| msgid "%sUnknown command \"%s\" (type /help for help)"
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%sНепозната команда „%s” (за помоћ откуцајте /help)"
+
+#, fuzzy, c-format
+#| msgid "%sUnknown command \"%s\" (type /help for help)"
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%sНепозната команда „%s” (за помоћ откуцајте /help)"
diff --git a/po/tr.po b/po/tr.po
index 97456fe95..525da5c89 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\n"
"PO-Revision-Date: 2022-10-15 22:51+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -146,6 +146,13 @@ msgstr "%sŞu eklenti için başka bir komut (\"%s\") halihazırda var: \"%s\""
#, fuzzy, c-format
#| msgid "%sUnknown command \"%s\" (type /help for help)"
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr "%s Bilinmeyen komut \"%s\" (yardım için /help yazın)"
+
+#, fuzzy, c-format
+#| msgid "%sUnknown command \"%s\" (type /help for help)"
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr "%s Bilinmeyen komut \"%s\" (yardım için /help yazın)"
diff --git a/po/weechat.pot b/po/weechat.pot
index a90ee12a8..8e16f6458 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-01-30 21:30+0100\n"
+"POT-Creation-Date: 2023-01-30 22:06+0100\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"
@@ -133,6 +133,12 @@ msgstr ""
#, c-format
msgid ""
+"%sUnknown command \"%s\" (commands are case sensitive, type /help for help), "
+"commands with similar name: %s"
+msgstr ""
+
+#, c-format
+msgid ""
"%sUnknown command \"%s\" (type /help for help), commands with similar name: "
"%s"
msgstr ""
diff --git a/src/core/hook/wee-hook-command.c b/src/core/hook/wee-hook-command.c
index dbe3b0653..55bc68a24 100644
--- a/src/core/hook/wee-hook-command.c
+++ b/src/core/hook/wee-hook-command.c
@@ -543,7 +543,7 @@ hook_command_similar_get_relevance (const char *cmd1, int length_cmd1,
/* perfect match if commands are the same (different case) */
if (strcmp (cmd1, cmd2) == 0)
- return -99;
+ return HOOK_COMMAND_SIMILAR_DIFF_CASE_ONLY;
/* init relevance with Levenshtein distance (lower is better) */
relevance = string_levenshtein (cmd1, cmd2, 1);
@@ -673,7 +673,7 @@ hook_command_display_error_unknown (const char *command)
struct t_arraylist *list_commands;
struct t_hook_command_similar *cmd_similar;
char **str_commands;
- int i, list_size, found;
+ int i, list_size, found, found_diff_case_only;
if (!command || !command[0])
return;
@@ -690,6 +690,7 @@ hook_command_display_error_unknown (const char *command)
}
found = 0;
+ found_diff_case_only = 0;
list_size = arraylist_size (list_commands);
for (i = 0; i < list_size; i++)
{
@@ -701,6 +702,8 @@ hook_command_display_error_unknown (const char *command)
string_dyn_concat (str_commands, ", ", -1);
string_dyn_concat (str_commands, cmd_similar->command, -1);
found++;
+ if (cmd_similar->relevance == HOOK_COMMAND_SIMILAR_DIFF_CASE_ONLY)
+ found_diff_case_only++;
if (found >= 5)
break;
}
@@ -710,6 +713,10 @@ hook_command_display_error_unknown (const char *command)
gui_chat_printf_date_tags (
NULL,
0, GUI_FILTER_TAG_NO_FILTER,
+ (found_diff_case_only > 0) ?
+ _("%sUnknown command \"%s\" (commands are case sensitive, "
+ "type /help for help), "
+ "commands with similar name: %s") :
_("%sUnknown command \"%s\" (type /help for help), "
"commands with similar name: %s"),
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
diff --git a/src/core/hook/wee-hook-command.h b/src/core/hook/wee-hook-command.h
index cec93e575..ab56ee3b0 100644
--- a/src/core/hook/wee-hook-command.h
+++ b/src/core/hook/wee-hook-command.h
@@ -37,6 +37,9 @@ struct t_gui_buffer;
#define HOOK_COMMAND_EXEC_AMBIGUOUS_INCOMPLETE -3
#define HOOK_COMMAND_EXEC_RUNNING -4
+/* same command found with a different case */
+#define HOOK_COMMAND_SIMILAR_DIFF_CASE_ONLY -99
+
typedef int (t_hook_callback_command)(const void *pointer, void *data,
struct t_gui_buffer *buffer,
int argc, char **argv, char **argv_eol);