core: add "length:xxx" and "lengthscr:xxx" in evaluation of expressions

v2.8-utf8proc
Sébastien Helleu 2019-09-21 07:56:21 +02:00
parent 1919f23c2d
commit dcfc4e8ed5
27 changed files with 364 additions and 225 deletions

View File

@ -20,7 +20,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
New features::
* core: add calculation of expression in evaluation of expressions with "calc:..." (issue #997)
* core: add length of string (number of chars and on screen) in evaluation of expressions with "length:xxx" and "lengthscr:xxx"
* core: add calculation of expression in evaluation of expressions with "calc:xxx" (issue #997)
* script: add options "-ol" and "-il" in command /script to send translated string with list of scripts loaded, display "No scripts loaded" if no scripts are loaded
Bug fixes::

View File

@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
7. a color (format: "color:xxx", see "Plugin API reference", function "color")
8. an info (format: "info:name,arguments", arguments are optional)
9. current date/time (format: "date" or "date:format")
10. an environment variable (format: "env:XXX")
11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
13. an option (format: "file.section.option")
14. a local variable in buffer
15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
9. an info (format: "info:name,arguments", arguments are optional)
10. current date/time (format: "date" or "date:format")
11. an environment variable (format: "env:XXX")
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
14. an option (format: "file.section.option")
15. a local variable in buffer
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):

View File

@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
7. a color (format: "color:xxx", see "Plugin API reference", function "color")
8. an info (format: "info:name,arguments", arguments are optional)
9. current date/time (format: "date" or "date:format")
10. an environment variable (format: "env:XXX")
11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
13. an option (format: "file.section.option")
14. a local variable in buffer
15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
9. an info (format: "info:name,arguments", arguments are optional)
10. current date/time (format: "date" or "date:format")
11. an environment variable (format: "env:XXX")
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
14. an option (format: "file.section.option")
15. a local variable in buffer
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):

View File

@ -2474,6 +2474,22 @@ expanded to last):
`+${repeat:5,-}+` |
`+-----+`
| `+${length:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string (number of UTF-8 chars). |
`+${length:test}+` +
`+${length:こんにちは世界}+` |
`+4+` +
`+7+`
| `+${lengthscr:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string displayed on screen. |
`+${lengthscr:test}+` +
`+${lengthscr:こんにちは世界}+` |
`+4+` +
`+14+`
| `+${re:N}+` +
(_WeeChat ≥ 1.1_) |
Regex captured group: `0` = whole string matching, `1` to `99` = group

View File

@ -303,15 +303,16 @@ Des variables sont remplacées dans l'expression, en utilisant le format ${varia
ou un maximum de caractères affichés à l'écran (format : "cutscr:max,suffixe,chaîne" ou "cutscr:+max,suffixe,chaîne")
5. une chaîne inversée (format : "rev:xxx")
6. une chaîne répétée (format : "repeat:nombre,chaîne")
7. une couleur (format : "color:xxx", voir la "Référence API extension", fonction "color")
8. une info (format : "info:nom,paramètres", les paramètres sont optionnels)
9. la date/heure courante (format : "date" ou "date:format")
10. une variable d'environnement (format : "env:XXX")
11. un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
12. le résultat d'une expression avec parenthèses et les opérateurs + - * / // % (format: "calc:xxx")
13. une option (format : "fichier.section.option")
14. une variable locale du tampon
15. 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.
7. longueur d'une chaîne (format : "length:xxx" ou "lengthscr:xxx")
8. une couleur (format : "color:xxx", voir la "Référence API extension", fonction "color")
9. une info (format : "info:nom,paramètres", les paramètres sont optionnels)
10. la date/heure courante (format : "date" ou "date:format")
11. une variable d'environnement (format : "env:XXX")
12. un opérateur ternaire (format : "if:condition?valeur_si_vrai:valeur_si_faux")
13. le résultat d'une expression avec parenthèses et les opérateurs + - * / // % (format: "calc:xxx")
14. une option (format : "fichier.section.option")
15. une variable locale du tampon
16. 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.
Le format du hdata peut être le suivant :
hdata.var1.var2... : démarrer avec un hdata (le pointeur doit être connu), et demander les variables l'une après l'autre (d'autres hdata peuvent être suivis)
hdata[liste].var1.var2... : démarrer avec un hdata en utilisant une liste, par exemple :
@ -338,6 +339,7 @@ Exemples (chaînes simples) :
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Exemples (conditions) :

View File

@ -2521,6 +2521,22 @@ première étendue à la dernière) :
`+${repeat:5,-}+` |
`+-----+`
| `+${length:xxx}+` +
(_WeeChat ≥ 2.7_) |
Longueur de la chaîne (nombre de caractères UTF-8). |
`+${length:test}+` +
`+${length:こんにちは世界}+` |
`+4+` +
`+7+`
| `+${lengthscr:xxx}+` +
(_WeeChat ≥ 2.7_) |
Longueur de la chaîne affichée à l'écran. |
`+${lengthscr:test}+` +
`+${lengthscr:こんにちは世界}+` |
`+4+` +
`+14+`
| `+${re:N}+` +
(_WeeChat ≥ 1.1_) |
Groupe regex capturé : `0` = toute la chaîne correspondante,

View File

@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
7. a color (format: "color:xxx", see "Plugin API reference", function "color")
8. an info (format: "info:name,arguments", arguments are optional)
9. current date/time (format: "date" or "date:format")
10. an environment variable (format: "env:XXX")
11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
13. an option (format: "file.section.option")
14. a local variable in buffer
15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
9. an info (format: "info:name,arguments", arguments are optional)
10. current date/time (format: "date" or "date:format")
11. an environment variable (format: "env:XXX")
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
14. an option (format: "file.section.option")
15. a local variable in buffer
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):

View File

@ -2582,6 +2582,22 @@ expanded to last):
`+${repeat:5,-}+` |
`+-----+`
| `+${length:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string (number of UTF-8 chars). |
`+${length:test}+` +
`+${length:こんにちは世界}+` |
`+4+` +
`+7+`
| `+${lengthscr:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string displayed on screen. |
`+${lengthscr:test}+` +
`+${lengthscr:こんにちは世界}+` |
`+4+` +
`+14+`
| `+${re:N}+` +
(_WeeChat ≥ 1.1_) |
Regex captured group: `0` = whole string matching, `1` to `99` = group
@ -2642,7 +2658,6 @@ expanded to last):
`+${if:${info:term_width}>80?big:small}+` |
`+big+`
// TRANSLATION MISSING
| `+${calc:xxx}+` +
(_WeeChat ≥ 2.7_) |
Result of expression, where parentheses and the following operators are

View File

@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
7. a color (format: "color:xxx", see "Plugin API reference", function "color")
8. an info (format: "info:name,arguments", arguments are optional)
9. current date/time (format: "date" or "date:format")
10. an environment variable (format: "env:XXX")
11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
13. an option (format: "file.section.option")
14. a local variable in buffer
15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
9. an info (format: "info:name,arguments", arguments are optional)
10. current date/time (format: "date" or "date:format")
11. an environment variable (format: "env:XXX")
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
14. an option (format: "file.section.option")
15. a local variable in buffer
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):

View File

@ -2485,6 +2485,24 @@ str5 = weechat.string_eval_expression("password=abc password=def", {}, {}, optio
`+${repeat:5,-}+` |
`+-----+`
// TRANSLATION MISSING
| `+${length:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string (number of UTF-8 chars). |
`+${length:test}+` +
`+${length:こんにちは世界}+` |
`+4+` +
`+7+`
// TRANSLATION MISSING
| `+${lengthscr:xxx}+` +
(_WeeChat ≥ 2.7_) |
Length of string displayed on screen. |
`+${lengthscr:test}+` +
`+${lengthscr:こんにちは世界}+` |
`+4+` +
`+14+`
| `+${re:N}+` +
(_WeeChat バージョン 1.1 以上で利用可_) |
正規表現のキャプチャグループ: `0` = マッチするすべての文字列、`1` から `99` =

View File

@ -303,15 +303,16 @@ Some variables are replaced in expression, using the format ${variable}, variabl
or max chars displayed on screen (format: "cutscr:max,suffix,string" or "cutscr:+max,suffix,string")
5. a reversed string (format: "rev:xxx")
6. a repeated string (format: "repeat:count,string")
7. a color (format: "color:xxx", see "Plugin API reference", function "color")
8. an info (format: "info:name,arguments", arguments are optional)
9. current date/time (format: "date" or "date:format")
10. an environment variable (format: "env:XXX")
11. a ternary operator (format: "if:condition?value_if_true:value_if_false")
12. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
13. an option (format: "file.section.option")
14. a local variable in buffer
15. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
7. length of a string (format: "length:xxx" or "lengthscr:xxx")
8. a color (format: "color:xxx", see "Plugin API reference", function "color")
9. an info (format: "info:name,arguments", arguments are optional)
10. current date/time (format: "date" or "date:format")
11. an environment variable (format: "env:XXX")
12. a ternary operator (format: "if:condition?value_if_true:value_if_false")
13. result of an expression with parentheses and operators + - * / // % (format: "calc:xxx")
14. an option (format: "file.section.option")
15. a local variable in buffer
16. a hdata name/variable (the value is automatically converted to string), by default "window" and "buffer" point to current window/buffer.
Format for hdata can be one of following:
hdata.var1.var2...: start with a hdata (pointer must be known), and ask variables one after one (other hdata can be followed)
hdata[list].var1.var2...: start with a hdata using a list, for example:
@ -338,6 +339,7 @@ Examples (simple strings):
/eval -n ${if:${info:term_width}>80?big:small} ==> big
/eval -n ${rev:Hello} ==> olleH
/eval -n ${repeat:5,-} ==> -----
/eval -n ${length:test} ==> 4
/eval -n ${calc:(5+2)*3} ==> 21
Examples (conditions):

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1572,18 +1572,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1618,6 +1619,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -24,7 +24,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-09-20 23:09+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@ -1661,6 +1661,7 @@ msgstr "evaluierter Ausdruck"
msgid "[-n|-s] <expression> || [-n] -c <expression1> <operator> <expression2>"
msgstr "[-n|-s] <expression> || [-n] -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 "
@ -1708,18 +1709,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1754,6 +1756,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1603,18 +1603,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1649,6 +1650,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"PO-Revision-Date: 2019-09-20 21:32+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-09-21 07:54+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -1677,18 +1677,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1723,6 +1724,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"
@ -1788,19 +1790,20 @@ msgstr ""
"suffixe,chaîne\" ou \"cutscr:+max,suffixe,chaîne\")\n"
" 5. une chaîne inversée (format : \"rev:xxx\")\n"
" 6. une chaîne répétée (format : \"repeat:nombre,chaîne\")\n"
" 7. une couleur (format : \"color:xxx\", voir la \"Référence API extension"
" 7. longueur d'une chaîne (format : \"length:xxx\" ou \"lengthscr:xxx\")\n"
" 8. une couleur (format : \"color:xxx\", voir la \"Référence API extension"
"\", fonction \"color\")\n"
" 8. une info (format : \"info:nom,paramètres\", les paramètres sont "
" 9. une info (format : \"info:nom,paramètres\", les paramètres sont "
"optionnels)\n"
" 9. la date/heure courante (format : \"date\" ou \"date:format\")\n"
" 10. une variable d'environnement (format : \"env:XXX\")\n"
" 11. un opérateur ternaire (format : \"if:condition?valeur_si_vrai:"
" 10. la date/heure courante (format : \"date\" ou \"date:format\")\n"
" 11. une variable d'environnement (format : \"env:XXX\")\n"
" 12. un opérateur ternaire (format : \"if:condition?valeur_si_vrai:"
"valeur_si_faux\")\n"
" 12. le résultat d'une expression avec parenthèses et les opérateurs + - "
" 13. le résultat d'une expression avec parenthèses et les opérateurs + - "
"* / // % (format: \"calc:xxx\")\n"
" 13. une option (format : \"fichier.section.option\")\n"
" 14. une variable locale du tampon\n"
" 15. un hdata/variable (la valeur est automatiquement convertie en chaîne), "
" 14. une option (format : \"fichier.section.option\")\n"
" 15. une variable locale du tampon\n"
" 16. 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"
@ -1837,6 +1840,7 @@ msgstr ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Exemples (conditions) :\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1491,18 +1491,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1537,6 +1538,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:31+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1586,18 +1586,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1632,6 +1633,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-06-22 08:40+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@ -1640,18 +1640,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1686,6 +1687,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-09-07 15:45+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@ -1675,18 +1675,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1721,6 +1722,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@ -1644,18 +1644,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1690,6 +1691,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1648,18 +1648,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1694,6 +1695,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1513,18 +1513,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1559,6 +1560,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+0200\n"
"PO-Revision-Date: 2019-05-13 21:32+0200\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -1344,18 +1344,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1390,6 +1391,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2019-09-20 21:31+0200\n"
"POT-Creation-Date: 2019-09-21 07:54+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"
@ -1346,18 +1346,19 @@ msgid ""
"or \"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
" 7. length of a string (format: \"length:xxx\" or \"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API reference\", function "
"\"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
" 9. an info (format: \"info:name,arguments\", arguments are optional)\n"
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: \"if:condition?value_if_true:value_if_false"
"\")\n"
" 12. result of an expression with parentheses and operators + - * / // % "
" 13. result of an expression with parentheses and operators + - * / // % "
"(format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted to "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -1392,6 +1393,7 @@ msgid ""
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -7355,19 +7355,21 @@ command_init ()
"\"cutscr:+max,suffix,string\")\n"
" 5. a reversed string (format: \"rev:xxx\")\n"
" 6. a repeated string (format: \"repeat:count,string\")\n"
" 7. a color (format: \"color:xxx\", see \"Plugin API "
" 7. length of a string (format: \"length:xxx\" or "
"\"lengthscr:xxx\")\n"
" 8. a color (format: \"color:xxx\", see \"Plugin API "
"reference\", function \"color\")\n"
" 8. an info (format: \"info:name,arguments\", arguments are "
" 9. an info (format: \"info:name,arguments\", arguments are "
"optional)\n"
" 9. current date/time (format: \"date\" or \"date:format\")\n"
" 10. an environment variable (format: \"env:XXX\")\n"
" 11. a ternary operator (format: "
" 10. current date/time (format: \"date\" or \"date:format\")\n"
" 11. an environment variable (format: \"env:XXX\")\n"
" 12. a ternary operator (format: "
"\"if:condition?value_if_true:value_if_false\")\n"
" 12. result of an expression with parentheses and operators "
" 13. result of an expression with parentheses and operators "
"+ - * / // % (format: \"calc:xxx\")\n"
" 13. an option (format: \"file.section.option\")\n"
" 14. a local variable in buffer\n"
" 15. a hdata name/variable (the value is automatically converted "
" 14. an option (format: \"file.section.option\")\n"
" 15. a local variable in buffer\n"
" 16. 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"
@ -7403,6 +7405,7 @@ command_init ()
" /eval -n ${if:${info:term_width}>80?big:small} ==> big\n"
" /eval -n ${rev:Hello} ==> olleH\n"
" /eval -n ${repeat:5,-} ==> -----\n"
" /eval -n ${length:test} ==> 4\n"
" /eval -n ${calc:(5+2)*3} ==> 21\n"
"\n"
"Examples (conditions):\n"

View File

@ -296,16 +296,18 @@ end:
* (format: cutscr:max,suffix,string or cutscr:+max,suffix,string)
* 6. a reversed string (format: rev:xxx)
* 7. a repeated string (format: repeat:count,string)
* 8. a regex group captured (format: re:N (0.99) or re:+)
* 9. a color (format: color:xxx)
* 10. an info (format: info:name,arguments)
* 11. current date/time (format: date or date:xxx)
* 12. an environment variable (format: env:XXX)
* 13. a ternary operator (format: if:condition?value_if_true:value_if_false)
* 14. calculate result of an expression (format: calc:xxx)
* 15. an option (format: file.section.option)
* 16. a buffer local variable
* 17. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
* 8. length of a string (format: length:xxx) or length of a string on screen
* (format: lengthscr:xxx)
* 9. a regex group captured (format: re:N (0.99) or re:+)
* 10. a color (format: color:xxx)
* 11. an info (format: info:name,arguments)
* 12. current date/time (format: date or date:xxx)
* 13. an environment variable (format: env:XXX)
* 14. a ternary operator (format: if:condition?value_if_true:value_if_false)
* 15. calculate result of an expression (format: calc:xxx)
* 16. an option (format: file.section.option)
* 17. a buffer local variable
* 18. a hdata variable (format: hdata.var1.var2 or hdata[list].var1.var2
* or hdata[ptr].var1.var2)
*
* See /help in WeeChat for examples.
@ -478,7 +480,25 @@ eval_replace_vars_cb (void *data, const char *text)
return string_repeat (pos + 1, number);
}
/* 8. regex group captured */
/*
* 8. length of string:
* length: number of chars
* lengthscr: number of chars displayed on screen
*/
if (strncmp (text, "length:", 7) == 0)
{
length = utf8_strlen (text + 7);
snprintf (str_value, sizeof (str_value), "%d", length);
return strdup (str_value);
}
if (strncmp (text, "lengthscr:", 10) == 0)
{
length = utf8_strlen_screen (text + 10);
snprintf (str_value, sizeof (str_value), "%d", length);
return strdup (str_value);
}
/* 9. regex group captured */
if (strncmp (text, "re:", 3) == 0)
{
if (eval_context->regex && eval_context->regex->result)
@ -509,7 +529,7 @@ eval_replace_vars_cb (void *data, const char *text)
return strdup ("");
}
/* 9. color code */
/* 10. color code */
if (strncmp (text, "color:", 6) == 0)
{
ptr_value = gui_color_search_config (text + 6);
@ -519,7 +539,7 @@ eval_replace_vars_cb (void *data, const char *text)
return strdup ((ptr_value) ? ptr_value : "");
}
/* 10. info */
/* 11. info */
if (strncmp (text, "info:", 5) == 0)
{
value = NULL;
@ -539,7 +559,7 @@ eval_replace_vars_cb (void *data, const char *text)
return (value) ? value : strdup ("");
}
/* 11. current date/time */
/* 12. current date/time */
if ((strncmp (text, "date", 4) == 0) && (!text[4] || (text[4] == ':')))
{
date = time (NULL);
@ -552,7 +572,7 @@ eval_replace_vars_cb (void *data, const char *text)
return strdup ((rc > 0) ? str_value : "");
}
/* 12. environment variable */
/* 13. environment variable */
if (strncmp (text, "env:", 4) == 0)
{
ptr_value = getenv (text + 4);
@ -560,7 +580,7 @@ eval_replace_vars_cb (void *data, const char *text)
return strdup (ptr_value);
}
/* 13: ternary operator: if:condition?value_if_true:value_if_false */
/* 14: ternary operator: if:condition?value_if_true:value_if_false */
if (strncmp (text, "if:", 3) == 0)
{
value = NULL;
@ -628,7 +648,7 @@ eval_replace_vars_cb (void *data, const char *text)
}
/*
* 14. calculate the result of an expression
* 15. calculate the result of an expression
* (with number, operators and parentheses)
*/
if (strncmp (text, "calc:", 5) == 0)
@ -636,7 +656,7 @@ eval_replace_vars_cb (void *data, const char *text)
return calc_expression (text + 5);
}
/* 15. option: if found, return this value */
/* 16. option: if found, return this value */
if (strncmp (text, "sec.data.", 9) == 0)
{
ptr_value = hashtable_get (secure_hashtable_data, text + 9);
@ -669,7 +689,7 @@ eval_replace_vars_cb (void *data, const char *text)
}
}
/* 16. local variable in buffer */
/* 17. local variable in buffer */
ptr_buffer = hashtable_get (eval_context->pointers, "buffer");
if (ptr_buffer)
{
@ -678,7 +698,7 @@ eval_replace_vars_cb (void *data, const char *text)
return strdup (ptr_value);
}
/* 17. hdata */
/* 18. hdata */
value = NULL;
hdata_name = NULL;
list_name = NULL;

View File

@ -363,6 +363,15 @@ TEST(CoreEval, EvalExpression)
WEE_CHECK_EVAL("cbacbacba", "${repeat:3,${rev:abc}}");
WEE_CHECK_EVAL("cbacba", "${repeat:${rev:20},${rev:abc}}");
/* test length of string */
WEE_CHECK_EVAL("0", "${length:}");
WEE_CHECK_EVAL("4", "${length:test}");
WEE_CHECK_EVAL("7", "${length:こんにちは世界}");
WEE_CHECK_EVAL("0", "${lengthscr:}");
WEE_CHECK_EVAL("4", "${lengthscr:test}");
WEE_CHECK_EVAL("14", "${lengthscr:こんにちは世界}");
/* test color */
WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}");
WEE_CHECK_EVAL(gui_color_get_custom ("*214"), "${color:*214}");