From a99fc17d400b9931bdcbc49c53ab7ea4501a2306 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sat, 17 Sep 2022 10:44:21 +0200 Subject: [PATCH] spell: allow special dict value "-" to disable spell checking on a specific buffer (closes #1699) --- ChangeLog.adoc | 1 + doc/de/includes/autogen_user_commands.de.adoc | 26 +++++----- doc/en/includes/autogen_user_commands.en.adoc | 4 +- doc/fr/includes/autogen_user_commands.fr.adoc | 4 +- doc/it/includes/autogen_user_commands.it.adoc | 6 +-- doc/ja/includes/autogen_user_commands.ja.adoc | 24 ++++----- doc/pl/includes/autogen_user_commands.pl.adoc | 26 +++++----- doc/sr/includes/autogen_user_commands.sr.adoc | 28 +++++----- po/cs.po | 18 +++++-- po/de.po | 51 +++++++++++++++---- po/es.po | 17 +++++-- po/fr.po | 25 ++++++--- po/hu.po | 15 ++++-- po/it.po | 21 ++++++-- po/ja.po | 44 ++++++++++++++-- po/pl.po | 44 ++++++++++++++-- po/pt.po | 22 ++++++-- po/pt_BR.po | 17 +++++-- po/ru.po | 15 ++++-- po/sr.po | 44 ++++++++++++++-- po/tr.po | 44 ++++++++++++++-- po/weechat.pot | 14 +++-- src/plugins/spell/spell-command.c | 18 +++++-- src/plugins/spell/spell-completion.c | 3 ++ src/plugins/spell/spell-config.c | 4 +- src/plugins/spell/spell-speller.c | 9 +++- 26 files changed, 414 insertions(+), 130 deletions(-) diff --git a/ChangeLog.adoc b/ChangeLog.adoc index a18744c91..7cf0f30f1 100644 --- a/ChangeLog.adoc +++ b/ChangeLog.adoc @@ -29,6 +29,7 @@ New features:: * buflist: add variable `${hotlist_priority_number}` (integer version of `${hotlist_priority}`) * irc: display SETNAME command in channels and private buffers, add options irc.color.message_setname and irc.look.smart_filter_setname (issue #1805) * irc: add option irc.look.display_pv_nick_change + * spell: allow special dict value "-" to disable spell checking on a specific buffer (issue #1699) * trigger: add elapsed time for trigger execution on monitor buffer when trigger debug is set, add option trigger.color.identifier (issue #1806) Bug fixes:: diff --git a/doc/de/includes/autogen_user_commands.de.adoc b/doc/de/includes/autogen_user_commands.de.adoc index b0b758df5..d8eaaa794 100644 --- a/doc/de/includes/autogen_user_commands.de.adoc +++ b/doc/de/includes/autogen_user_commands.de.adoc @@ -3063,27 +3063,27 @@ Beispiele: ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict addword [] - enable: Rechtschreibprüfung wird aktiviert - disable: Rechtschreibprüfung wird deaktiviert - toggle: Funktionalität der Rechtschreibprüfung umschalten -listdict: die, auf dem System, installierten Wörterbücher werden aufgelistet - setdict: Wörterbuch für den aktuellen Buffer einstellen (mehrere Wörterbücher müssen durch Kommata getrennt werden) - deldict: Wörterbuch für den aktuellen Buffer entfernen - addword: fügt ein Wort in das persönliche Wörterbuch hinzu + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary -Eingaben die mit '/' beginnen werden nicht überprüft, davon ausgenommen sind einige Befehle (siehe /set spell.check.commands). +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). -Um die Rechtschreibprüfung auf allen Buffer anzuwenden sollte die Einstellung "default_dict" genutzt und die Rechtschreibprüfung aktiviert werden: - /set spell.check.default_dict "de_DE-neu" +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" /spell enable -Um sich eine Liste von Vorschlägen in einer Bar anzeigen zu lassen nutzt man das Item "spell_suggest". +To display a list of suggestions in a bar, use item "spell_suggest". -Die Standardtastaturbelegung zum Umschalten der Rechtschreibprüfung lautet alt-s. +Default key to toggle spell checker is alt-s. ---- // end::spell_commands[] diff --git a/doc/en/includes/autogen_user_commands.en.adoc b/doc/en/includes/autogen_user_commands.en.adoc index da8017e48..ec2d4b99f 100644 --- a/doc/en/includes/autogen_user_commands.en.adoc +++ b/doc/en/includes/autogen_user_commands.en.adoc @@ -3063,7 +3063,7 @@ Examples: ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict addword [] @@ -3071,7 +3071,7 @@ Examples: disable: disable spell checker toggle: toggle spell checker listdict: show installed dictionaries - setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) deldict: delete dictionary used on current buffer addword: add a word in personal dictionary diff --git a/doc/fr/includes/autogen_user_commands.fr.adoc b/doc/fr/includes/autogen_user_commands.fr.adoc index 2324e7671..860b2286c 100644 --- a/doc/fr/includes/autogen_user_commands.fr.adoc +++ b/doc/fr/includes/autogen_user_commands.fr.adoc @@ -3063,7 +3063,7 @@ Exemples : ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict addword [] @@ -3071,7 +3071,7 @@ Exemples : disable : désactiver le vérificateur d'orthographe toggle : activer/désactiver le vérificateur d'orthographe listdict : afficher les dictionnaires installés - setdict : définir le dictionnaire pour le tampon courant (plusieurs dictionnaires peuvent être séparés par une virgule) + setdict : définir le dictionnaire pour le tampon courant (plusieurs dictionnaires peuvent être séparés par une virgule, la valeur spéciale "-" désactive la vérification orthographique sur le tampon courant) deldict : supprimer le dictionnaire utilisé sur le tampon courant addword : ajouter un mot dans le dictionnaire personnel diff --git a/doc/it/includes/autogen_user_commands.it.adoc b/doc/it/includes/autogen_user_commands.it.adoc index c278d755f..538920751 100644 --- a/doc/it/includes/autogen_user_commands.it.adoc +++ b/doc/it/includes/autogen_user_commands.it.adoc @@ -3063,15 +3063,15 @@ Examples: ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict - addword [] + addword [] enable: enable spell checker disable: disable spell checker toggle: toggle spell checker listdict: show installed dictionaries - setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma) + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) deldict: delete dictionary used on current buffer addword: add a word in personal dictionary diff --git a/doc/ja/includes/autogen_user_commands.ja.adoc b/doc/ja/includes/autogen_user_commands.ja.adoc index 2638097c4..decabcddf 100644 --- a/doc/ja/includes/autogen_user_commands.ja.adoc +++ b/doc/ja/includes/autogen_user_commands.ja.adoc @@ -3063,27 +3063,27 @@ Examples: ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict addword [] - enable: スペルチェックの有効化 - disable: スペルチェックの無効化 - toggle: スペルチェックの有効無効を切り替え -listdict: インストール済み辞書を表示 - setdict: 現在のバッファ用の辞書を設定 (コンマで区切れば複数の辞書を指定可能) - deldict: 現在のバッファ用の辞書を削除 - addword: 個人辞書に単語を追加 + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary -一部のコマンドを除いて '/' で始まる入力行はチェックされません (/set spell.check.commands を参照してください)。 +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). -全てのバッファでスペルチェックを有効化するには、"default_dict" オプションを設定した後に、スペルチェックを有効化してください。例: +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: /set spell.check.default_dict "en" /spell enable -バーの中にスペル候補リストを表示するには、"spell_suggest" 要素を使ってください。 +To display a list of suggestions in a bar, use item "spell_suggest". -スペルチェックの有効無効を切り替えるデフォルトのキーは alt-s です。 +Default key to toggle spell checker is alt-s. ---- // end::spell_commands[] diff --git a/doc/pl/includes/autogen_user_commands.pl.adoc b/doc/pl/includes/autogen_user_commands.pl.adoc index ae57e473c..4b7ae9531 100644 --- a/doc/pl/includes/autogen_user_commands.pl.adoc +++ b/doc/pl/includes/autogen_user_commands.pl.adoc @@ -3062,27 +3062,27 @@ Przykłady: ---- /spell enable|disable|toggle listdict - setdict [,...] + setdict -|[,...] deldict - addword [] + addword [] - enable: włącza sprawdzanie pisowni - disable: wyłącza sprawdzanie pisowni - toggle: przełącza sprawdzanie pisowni -listdict: pokazuje zainstalowane słowniki - setdict: ustawia słownik dla obecnego buforu (kilka słowników może być podanych po przecinku) - deldict: usuwa słownik używany w obecnym buforze - addword: dodaje słowo do osobistego słownika + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary -Jeśli wprowadzany tekst zaczyna się od '/' nie będzie on sprawdzany, za wyjątkiem kilku komend (zobacz /set spell.check.commands). +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). -W celu włączenia sprawdzania pisowni dla wszystkich buforów, należy użyć opcji "default_dict", następnie włączyć sprawdzanie pisowni, na przykład: +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: /set spell.check.default_dict "en" /spell enable -W celu wyświetlenia listy sugestii na pasku, użyj elementu "spell_suggest". +To display a list of suggestions in a bar, use item "spell_suggest". -Domyślny skrót klawiszowy przełączający sprawdzanie pisowni to alt-s. +Default key to toggle spell checker is alt-s. ---- // end::spell_commands[] diff --git a/doc/sr/includes/autogen_user_commands.sr.adoc b/doc/sr/includes/autogen_user_commands.sr.adoc index 5870fb964..771b40bec 100644 --- a/doc/sr/includes/autogen_user_commands.sr.adoc +++ b/doc/sr/includes/autogen_user_commands.sr.adoc @@ -3063,27 +3063,27 @@ toggleautoload: пребацивање аутоматског учитавања ---- /spell enable|disable|toggle listdict - setdict <речн>[,<речн>...] + setdict -|[,...] deldict - addword [<речн>] <реч> + addword [] - enable: укључивање програма за проверу правописа - disable: искључивање програма за проверу правописа - toggle: пребацивање програма за проверу правописа -listdict: приказ инсталираних речника - setdict: постављање речника за текући бафер (више речника може да се раздвоји запетама) - deldict: брисање речника који се користи за текући бафер - addword: додавање речи у лични речник + enable: enable spell checker + disable: disable spell checker + toggle: toggle spell checker +listdict: show installed dictionaries + setdict: set dictionary for current buffer (multiple dictionaries can be separated by a comma, the special value "-" disables spell checking on current buffer) + deldict: delete dictionary used on current buffer + addword: add a word in personal dictionary -Линије уноса које почињу са ’/’ се не проверавају, осим за неке команде (погледајте /set spell.check.commands). +Input line beginning with a '/' is not checked, except for some commands (see /set spell.check.commands). -Ако желите да укључите програм за проверу правописа у свим баферима, употребите опцију „default_dict”, па затим укључите програм за проверу правописа, на пример: - /set spell.check.default_dict „en” +To enable spell checker on all buffers, use option "default_dict", then enable spell checker, for example: + /set spell.check.default_dict "en" /spell enable -Ако желите да се у траци прикаже листа предлога, употребите ставку „spell_suggest”. +To display a list of suggestions in a bar, use item "spell_suggest". -Подразумевани тастер за пребацивање програма за проверу правописа је alt-s. +Default key to toggle spell checker is alt-s. ---- // end::spell_commands[] diff --git a/po/cs.po b/po/cs.po index 73289f276..66766903f 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: 2022-09-14 21:38+0200\n" +"POT-Creation-Date: 2022-09-17 09:34+0200\n" "PO-Revision-Date: 2022-06-18 16:11+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -12457,6 +12457,11 @@ msgstr "" msgid "%s dictionaries list:" msgstr "seznam slovníků %s:" +#, fuzzy +#| msgid "Spell checking is disabled" +msgid "spell checking disabled" +msgstr "Kontrola pravopisu je vypnuta" + #, c-format msgid "%s: \"%s\" removed" msgstr "%s: \"%s\" odebrán" @@ -12520,7 +12525,7 @@ msgstr "konfigurace pluginu aspell" #, fuzzy msgid "" -"enable|disable|toggle || listdict || setdict [,...] || deldict " +"enable|disable|toggle || listdict || setdict -|[,...] || deldict " "|| addword [] " msgstr "dictlist || enable || disable || addword [] " @@ -12531,7 +12536,8 @@ msgid "" " toggle: toggle spell checker\n" "listdict: show installed dictionaries\n" " setdict: set dictionary for current buffer (multiple dictionaries can be " -"separated by a comma)\n" +"separated by a comma, the special value \"-\" disables spell checking on " +"current buffer)\n" " deldict: delete dictionary used on current buffer\n" " addword: add a word in personal dictionary\n" "\n" @@ -12562,7 +12568,11 @@ msgstr "seznam všech podporovaných jazyků aspellem" msgid "list of installed dictionaries" msgstr "seznam instalovaných slovníků aspellu" -msgid "comma separated list of dictionaries to use on this buffer" +#, fuzzy +#| msgid "comma separated list of dictionaries to use on this buffer" +msgid "" +"comma separated list of dictionaries to use on this buffer (special value \"-" +"\" disables spell checking on this buffer)" msgstr "čárkami oddělený seznam slovníků, které použít pro tento buffer" #, fuzzy, c-format diff --git a/po/de.po b/po/de.po index d8ee299b1..1dba20b59 100644 --- a/po/de.po +++ b/po/de.po @@ -25,7 +25,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2022-09-14 21:38+0200\n" +"POT-Creation-Date: 2022-09-17 09:34+0200\n" "PO-Revision-Date: 2022-09-16 08:22+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -10808,7 +10808,6 @@ msgstr "" "es wird bei einer privaten Unterhaltung eine Mitteilung ausgegeben falls der " "User wieder zurück ist (falls der User sich beim Server abgemeldet hat)" -#| msgid "use same nick color for channel and private" msgid "display nick change in private" msgstr "Nickänderung im privaten Buffer anzeigen" @@ -14992,6 +14991,11 @@ msgstr "" msgid "%s dictionaries list:" msgstr "%s Wörterbücher:" +#, fuzzy +#| msgid "Spell checking is disabled" +msgid "spell checking disabled" +msgstr "Rechtschreibprüfung ist deaktiviert" + #, c-format msgid "%s: \"%s\" removed" msgstr "%s: \"%s\" entfernt" @@ -15053,20 +15057,47 @@ msgstr "Rechtschreibprüfung ist deaktiviert" msgid "spell plugin configuration" msgstr "Konfiguration für spell-Erweiterung" +#, fuzzy +#| msgid "" +#| "enable|disable|toggle || listdict || setdict [,...] || " +#| "deldict || addword [] " msgid "" -"enable|disable|toggle || listdict || setdict [,...] || deldict " +"enable|disable|toggle || listdict || setdict -|[,...] || deldict " "|| addword [] " msgstr "" "enable|disable|toggle || listdict || setdict [,...] || deldict " "|| addword [] " +#, fuzzy +#| msgid "" +#| " enable: enable spell checker\n" +#| " disable: disable spell checker\n" +#| " toggle: toggle spell checker\n" +#| "listdict: show installed dictionaries\n" +#| " setdict: set dictionary for current buffer (multiple dictionaries can be " +#| "separated by a comma)\n" +#| " deldict: delete dictionary used on current buffer\n" +#| " addword: add a word in personal dictionary\n" +#| "\n" +#| "Input line beginning with a '/' is not checked, except for some commands " +#| "(see /set spell.check.commands).\n" +#| "\n" +#| "To enable spell checker on all buffers, use option \"default_dict\", then " +#| "enable spell checker, for example:\n" +#| " /set spell.check.default_dict \"en\"\n" +#| " /spell enable\n" +#| "\n" +#| "To display a list of suggestions in a bar, use item \"spell_suggest\".\n" +#| "\n" +#| "Default key to toggle spell checker is alt-s." msgid "" " enable: enable spell checker\n" " disable: disable spell checker\n" " toggle: toggle spell checker\n" "listdict: show installed dictionaries\n" " setdict: set dictionary for current buffer (multiple dictionaries can be " -"separated by a comma)\n" +"separated by a comma, the special value \"-\" disables spell checking on " +"current buffer)\n" " deldict: delete dictionary used on current buffer\n" " addword: add a word in personal dictionary\n" "\n" @@ -15113,7 +15144,11 @@ msgstr "Liste aller Sprachen die unterstützt werden" msgid "list of installed dictionaries" msgstr "Auflistung der installierten Wörterbücher" -msgid "comma separated list of dictionaries to use on this buffer" +#, fuzzy +#| msgid "comma separated list of dictionaries to use on this buffer" +msgid "" +"comma separated list of dictionaries to use on this buffer (special value \"-" +"\" disables spell checking on this buffer)" msgstr "" "durch Kommata getrennte Liste von Wörterbüchern, welche in diesem Buffer " "genutzt werden sollen" @@ -15443,8 +15478,7 @@ msgstr "verwaltet Trigger, das Schweizer Armeemesser für WeeChat" msgid "" "list|listfull|listdefault || add|addoff|addreplace " -"[\"\" [\"\" [\"\" [\"\" [\"<" -"return_code>\" [\"\"]]]]]] " +"[\"\" [\"\" [\"\" [\"\" [\"\" [\"\"]]]]]] " "|| addinput [] || input|output|recreate || set