1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-10 11:05:42 +02:00

api: add translated string in evaluation of expressions with "translate:xxx" (issue #1622)

This commit is contained in:
Sébastien Helleu
2021-05-16 09:49:09 +02:00
parent 7e10038f4b
commit 5bce484c01
20 changed files with 154 additions and 86 deletions
+1
View File
@@ -26,6 +26,7 @@ New features::
* core: evaluate option weechat.plugin.path, change default value to "${weechat_data_dir}/plugins"
* core: add options to customize commands executed on system signals received (SIGHUP, SIGQUIT, SIGTERM, SIGUSR1, SIGUSR2) (issue #1595)
* core: quit WeeChat by default when signal SIGHUP is received in normal run, reload configuration in weechat-headless (issue #1595)
* api: add translated string in evaluation of expressions with "translate:xxx"
* api: add evaluation of WeeChat directories with "${weechat_xxx_dir}" in evaluated strings
* api: add optional key "directory" in hashtable options of function/modifier string_eval_path_home
* api: add supported prefixes "${weechat_xxx_dir}" in function mkdir_home
+6
View File
@@ -2758,6 +2758,12 @@ expanded to last):
`+0.2+` +
`+65536+`
| `+${translate:xxx}+` +
_(WeeChat ≥ 3.2)_ |
Translated string (depends on the language used by WeeChat to display messages). |
`+${translate:Plugin}+` |
`+Extension+` (example in French)
| `+${sec.data.name}+` |
Value of the secured data `name`. |
`+${sec.data.freenode_pass}+` |
+7
View File
@@ -2804,6 +2804,13 @@ première étendue à la dernière) :
`+0.2+` +
`+65536+`
| `+${translate:xxx}+` +
_(WeeChat ≥ 3.2)_ |
Chaîne traduite (dépend de la langue utilisée par WeeChat pour afficher les
messages). |
`+${translate:Plugin}+` |
`+Extension+` (exemple en Français)
| `+${sec.data.nom}+` |
Valeur de la donnée sécurisée `nom`. |
`+${sec.data.freenode_pass}+` |
File diff suppressed because it is too large Load Diff
+7
View File
@@ -2796,6 +2796,13 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
`+0.2+` +
`+65536+`
// TRANSLATION MISSING
| `+${translate:xxx}+` +
_(WeeChat ≥ 3.2)_ |
Translated string (depends on the language used by WeeChat to display messages). |
`+${translate:Plugin}+` |
`+Extension+` (example in French)
| `+${sec.data.name}+` |
セキュアデータ `name` の値 |
`+${sec.data.freenode_pass}+` |
+6 -4
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:49+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1608,9 +1608,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1654,6 +1655,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+7 -4
View File
@@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 23:44+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -1676,6 +1676,7 @@ msgstr ""
"[-n|-s] [-d] <expression> || [-n] [-d [-d]] -c <expression1> <operator> "
"<expression2>"
#, fuzzy
msgid ""
" -n: display result without sending it to buffer (debug mode)\n"
" -s: split expression before evaluating it (many commands can be "
@@ -1750,9 +1751,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1796,6 +1798,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1637,9 +1637,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1683,6 +1684,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+12 -8
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"PO-Revision-Date: 2021-05-16 08:36+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-16 09:47+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -1723,9 +1723,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1769,6 +1770,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
@@ -1860,9 +1862,10 @@ msgstr ""
"valeur_si_faux\")\n"
" 17. le résultat d'une expression avec parenthèses et les opérateurs + - "
"* / // % ** (format: \"calc:xxx\")\n"
" 18. une option (format : \"fichier.section.option\")\n"
" 19. une variable locale du tampon\n"
" 20. un hdata/variable (la valeur est automatiquement convertie en chaîne), "
" 18. une chaîne traduite (format : \"translate:xxx\")\n"
" 19. une option (format : \"fichier.section.option\")\n"
" 20. une variable locale du tampon\n"
" 21. un hdata/variable (la valeur est automatiquement convertie en chaîne), "
"par défaut \"window\" et \"buffer\" pointent vers la fenêtre et le tampon "
"courants.\n"
"Le format du hdata peut être le suivant :\n"
@@ -1907,6 +1910,7 @@ msgstr ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Exemples (conditions) :\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1524,9 +1524,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1570,6 +1571,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1620,9 +1620,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1666,6 +1667,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -1676,9 +1676,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1722,6 +1723,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -1718,9 +1718,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1764,6 +1765,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -1679,9 +1679,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1725,6 +1726,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1683,9 +1683,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1729,6 +1730,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1546,9 +1546,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1592,6 +1593,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+0200\n"
"PO-Revision-Date: 2021-05-15 16:50+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -1379,9 +1379,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1425,6 +1426,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+6 -4
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2021-05-16 08:35+0200\n"
"POT-Creation-Date: 2021-05-16 09:47+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"
@@ -1381,9 +1381,10 @@ msgid ""
"\")\n"
" 17. result of an expression with parentheses and operators + - * / // % ** "
"(format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted to "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted to "
"string), by default \"window\" and \"buffer\" point to current window/"
"buffer.\n"
"Format for hdata can be one of following:\n"
@@ -1427,6 +1428,7 @@ msgid ""
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+5 -3
View File
@@ -7571,9 +7571,10 @@ command_init ()
"\"if:condition?value_if_true:value_if_false\")\n"
" 17. result of an expression with parentheses and operators "
"+ - * / // % ** (format: \"calc:xxx\")\n"
" 18. an option (format: \"file.section.option\")\n"
" 19. a local variable in buffer\n"
" 20. a hdata name/variable (the value is automatically converted "
" 18. a translated string (format: \"translate:xxx\")\n"
" 19. an option (format: \"file.section.option\")\n"
" 20. a local variable in buffer\n"
" 21. a hdata name/variable (the value is automatically converted "
"to string), by default \"window\" and \"buffer\" point to current "
"window/buffer.\n"
"Format for hdata can be one of following:\n"
@@ -7617,6 +7618,7 @@ command_init ()
" /eval -n ${calc:(5+2)*3} ==> 21\n"
" /eval -n ${base_encode:64,test} ==> dGVzdA==\n"
" /eval -n ${base_decode:64,dGVzdA==} ==> test\n"
" /eval -n ${translate:Plugin} ==> Extension\n"
"\n"
"Examples (conditions):\n"
" /eval -n -c ${window.buffer.number} > 2 ==> 0\n"
+36 -7
View File
@@ -725,6 +725,25 @@ eval_string_if (const char *text, struct t_eval_context *eval_context)
return (value) ? value : strdup ("");
}
/*
* Translates text.
*
* Note: result must be freed after use.
*/
char *
eval_translate (const char *text)
{
const char *ptr_string;
if (!text || !text[0])
return strdup ("");
ptr_string = gettext (text);
return strdup ((ptr_string) ? ptr_string : "");
}
/*
* Gets value of hdata using "path" to a variable.
*
@@ -1034,10 +1053,11 @@ end:
* 18. an environment variable (format: env:XXX)
* 19. a ternary operator (format: if:condition?value_if_true:value_if_false)
* 20. calculate result of an expression (format: calc:xxx)
* 21. an option (format: file.section.option)
* 22. a buffer local variable
* 23. a pointer name from hashtable "pointers"
* 24. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
* 21. a translated string (format: translate:xxx)
* 22. an option (format: file.section.option)
* 23. a buffer local variable
* 24. a pointer name from hashtable "pointers"
* 25. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
* or hdata[ptr].var1.var2 or hdata[ptr_name].var1.var2)
*
* See /help in WeeChat for examples.
@@ -1285,7 +1305,16 @@ eval_replace_vars_cb (void *data, const char *text)
goto end;
}
/* 21. option: if found, return this value */
/*
* 21. translated text
*/
if (strncmp (text, "translate:", 10) == 0)
{
value = eval_translate (text + 10);
goto end;
}
/* 22. option: if found, return this value */
if (strncmp (text, "sec.data.", 9) == 0)
{
ptr_value = hashtable_get (secure_hashtable_data, text + 9);
@@ -1328,7 +1357,7 @@ eval_replace_vars_cb (void *data, const char *text)
}
}
/* 22. local variable in buffer */
/* 23. local variable in buffer */
ptr_buffer = hashtable_get (eval_context->pointers, "buffer");
if (ptr_buffer)
{
@@ -1340,7 +1369,7 @@ eval_replace_vars_cb (void *data, const char *text)
}
}
/* 23. hdata */
/* 24. hdata */
value = eval_string_hdata (text, eval_context);
end: