* 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
`+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}+` |
`+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}+` |
str3 = weechat.string_input_for_buffer("//test") # "/test"
----
+// TRANSLATION MISSING
==== string_eval_expression
-// TRANSLATION MISSING
_WeeChat ≥ 0.4.0, updated in 0.4.2, 0.4.3, 1.0, 1.1, 1.2, 1.3, 1.6, 1.8, 2.0,
2.2, 2.3, 2.7, 2.9, 3.1 and 3.2._
-// TRANSLATION MISSING
Evaluate an expression and return result as a string.
Special variables with format `+${variable}+` are expanded (see table below).
-// TRANSLATION MISSING
[NOTE]
Since version 1.0, nested variables are supported, for example:
`+${color:${variable}}+`.
Argomenti:
-// TRANSLATION MISSING
* _expr_: the expression to evaluate (see <<eval_conditions,conditions>> and
<<eval_variables,variables>>)
* _pointers_: hashtable with pointers (keys must be string, values must be
** _regex_replace_: the replacement text to use with _regex_, to replace
text in _expr_ (the _regex_replace_ is evaluated on each match of _regex_
against _expr_, until no match is found)
-// TRANSLATION MISSING
** _debug_: debug level (string with integer number ≥ 1), if enabled, a key
"debug_output" is added in hashtable _options_:
*** _1_: enable debug
Valore restituito:
-// TRANSLATION MISSING
* evaluated expression (must be freed by calling "free" after use), or NULL
if problem (invalid expression or not enough memory)
str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, options) # "password=*** password=***"
----
-// TRANSLATION MISSING
[[eval_conditions]]
===== Conditions
-// TRANSLATION MISSING
List of logical operators that can be used in conditions (by order of priority,
from first used to last):
-// TRANSLATION MISSING
[width="100%",cols="2,8,4,4",options="header"]
|===
| Operator | Description | Examples | Results
`+0+`
|===
-// TRANSLATION MISSING
List of comparison operators that can be used in conditions (by order of priority,
from first used to last):
-// TRANSLATION MISSING
[width="100%",cols="2,8,4,4",options="header"]
|===
| Operator | Description | Examples | Results
`+1+`
|===
-// TRANSLATION MISSING
The comparison is made using floating point numbers if the two expressions are
valid numbers, with one of the following formats:
* floating point number (examples: 5.2, -7.5, 2.83e-2) _(WeeChat ≥ 2.0)_
* hexadecimal number (examples: 0xA3, -0xA3) _(WeeChat ≥ 2.0)_
-// TRANSLATION MISSING
To force a string comparison, you can add double quotes around each expression,
for example:
* `50 > 100` returns 0 (number comparison)
* `"50" > "100"` returns 1 (string comparison)
-// TRANSLATION MISSING
[[eval_variables]]
===== Variables
-// TRANSLATION MISSING
List of variables expanded in expression (by order of priority, from first
expanded to last):
-// TRANSLATION MISSING
[width="100%",cols="2,8,4,4",options="header"]
|===
| Format | Description | Examples | Results
-// TRANSLATION MISSING
| `+${raw:xxx}+` +
_(WeeChat ≥ 3.1)_ |
Raw string (not evaluated). |
`+${name}+` |
`+value+`
-// TRANSLATION MISSING
| `+${weechat_xxx_dir}+` |
A WeeChat directory: `+${weechat_config_dir}+`, `+${weechat_data_dir}+`,
`+${weechat_cache_dir}+` or `+${weechat_runtime_dir}+`. |
`+1.0+` +
`+lightblue+`
-// TRANSLATION MISSING
| `+${base_encode:base,xxx}+` +
_(WeeChat ≥ 2.9)_ |
String encoded in base 16, 32 or 64. |
`+ORSXG5BAON2HE2LOM4======+` +
`+dGVzdCBzdHJpbmc=+`
-// TRANSLATION MISSING
| `+${base_decode:base,xxx}+` +
_(WeeChat ≥ 2.9)_ |
String decoded from base 16, 32 or 64. |
`+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}+` |
`+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}+` |
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"
"\")\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"
" /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"
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"
"[-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 "
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
"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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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/"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
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"
"\")\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"
" /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"
"\"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"
" /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"
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.
*
* 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.
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);
}
}
- /* 22. local variable in buffer */
+ /* 23. local variable in buffer */
ptr_buffer = hashtable_get (eval_context->pointers, "buffer");
if (ptr_buffer)
{
}
}
- /* 23. hdata */
+ /* 24. hdata */
value = eval_string_hdata (text, eval_context);
end: