diff options
-rw-r--r-- | ChangeLog.asciidoc | 1 | ||||
-rw-r--r-- | po/cs.po | 44 | ||||
-rw-r--r-- | po/de.po | 45 | ||||
-rw-r--r-- | po/es.po | 44 | ||||
-rw-r--r-- | po/fr.po | 89 | ||||
-rw-r--r-- | po/hu.po | 44 | ||||
-rw-r--r-- | po/it.po | 44 | ||||
-rw-r--r-- | po/ja.po | 45 | ||||
-rw-r--r-- | po/pl.po | 45 | ||||
-rw-r--r-- | po/pt_BR.po | 44 | ||||
-rw-r--r-- | po/ru.po | 44 | ||||
-rw-r--r-- | po/tr.po | 44 | ||||
-rw-r--r-- | po/weechat.pot | 44 | ||||
-rw-r--r-- | src/core/wee-command.c | 42 | ||||
-rw-r--r-- | src/core/wee-eval.c | 46 | ||||
-rw-r--r-- | tests/unit/core/test-eval.cpp | 33 |
16 files changed, 392 insertions, 306 deletions
diff --git a/ChangeLog.asciidoc b/ChangeLog.asciidoc index 7063f78a0..aba4adf84 100644 --- a/ChangeLog.asciidoc +++ b/ChangeLog.asciidoc @@ -17,6 +17,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes] === New features +* core: add hide of chars in string in evaluation of expressions * core: add arraylists, improve speed of completions (about 50x faster) * core: move bar item "scroll" between buffer name and lag in default bar items of status bar @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1422,11 +1422,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1440,23 +1441,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-09-21 19:48+0100\n" "Last-Translator: Nils Görs <weechatter@arcor.de>\n" "Language-Team: German <weechatter@arcor.de>\n" @@ -1464,6 +1464,7 @@ msgstr "evaluierter Ausdruck" msgid "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" msgstr "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" " -c: evaluate as condition: use operators and parentheses, return a " @@ -1496,11 +1497,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1514,23 +1516,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: gibt das Ergebnis aus, ohne das dieses in den Buffer gesendet " "wird (debug Modus)\n" @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1460,11 +1460,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1478,23 +1479,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" -"PO-Revision-Date: 2014-10-08 22:23+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" +"PO-Revision-Date: 2014-10-16 20:44+0200\n" "Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "Language: fr\n" @@ -1474,11 +1474,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1492,23 +1493,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n : afficher le résultat sans envoyer au tampon (mode debug)\n" " -c : évaluer comme une condition : utiliser les opérateurs et les " @@ -1544,12 +1546,14 @@ msgstr "" "${variable}, la variable pouvant être, par ordre de priorité :\n" " 1. une chaîne avec les caractères échappés (format : \"esc:xxx\" ou \"\\xxx" "\")\n" -" 2. une couleur (format : \"color:xxx\")\n" -" 3. une info (format : \"info:nom,paramètres\", les paramètres sont " +" 2. une chaîne avec des caractères à cacher (format : \"hide:caractère," +"chaîne\")\n" +" 3. une couleur (format : \"color:xxx\")\n" +" 4. une info (format : \"info:nom,paramètres\", les paramètres sont " "optionnels)\n" -" 4. une option (format : \"fichier.section.option\")\n" -" 5. une variable locale du tampon\n" -" 6. un hdata/variable (la valeur est automatiquement convertie en chaîne), " +" 5. une option (format : \"fichier.section.option\")\n" +" 6. une variable locale du tampon\n" +" 7. 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" @@ -1566,23 +1570,24 @@ msgstr "" "fonction \"weechat_hdata_get\".\n" "\n" "Exemples (chaînes simples) :\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Exemples (conditions) :\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgid "" "filter messages in buffers, to hide/show them according to tags or regex" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1353,11 +1353,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1371,23 +1372,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1440,11 +1440,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1458,23 +1459,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: mostra il risultato senza inviarlo al buffer (modalità debug)\n" "espressione: espressione da analizzare, le variabili con il formato " @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-09-20 23:10+0900\n" "Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n" "Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n" @@ -1407,6 +1407,7 @@ msgstr "式を評価" msgid "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" msgstr "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" " -c: evaluate as condition: use operators and parentheses, return a " @@ -1439,11 +1440,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1457,23 +1459,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: 結果をバッファに送信せずに表示 (デバッグモード)\n" " -c: 条件として評価: 演算子と括弧をを使い、ブール値 (\"0\" または " @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-09-14 00:18+0100\n" "Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1442,6 +1442,7 @@ msgstr "przetwórz wyrażenie" msgid "[-n] <expression> || [-n] -c <expression1> <operator> <expression2>" msgstr "[-n] <wyrażenie> || [-n] -c <wyrażenie1> <operator> <wyrażenie2>" +#, fuzzy msgid "" " -n: display result without sending it to buffer (debug mode)\n" " -c: evaluate as condition: use operators and parentheses, return a " @@ -1474,11 +1475,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1492,23 +1494,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" " -n: wyświetla wynik bez wysyłania go do buforu (tryb debugowania)\n" " -c: przetwarza jako warunek: użyj operatorów i nawiasów, zwraca " diff --git a/po/pt_BR.po b/po/pt_BR.po index ebc6d77c2..2a0341a1b 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1477,11 +1477,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1495,23 +1496,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-08-16 11:46+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1375,11 +1375,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1393,23 +1394,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+0200\n" "PO-Revision-Date: 2014-07-25 07:50+0200\n" "Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -1210,11 +1210,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1228,23 +1229,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" diff --git a/po/weechat.pot b/po/weechat.pot index fed784ede..c210ede36 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2014-10-08 22:22+0200\n" +"POT-Creation-Date: 2014-10-16 20:40+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" @@ -1214,11 +1214,12 @@ msgid "" "Some variables are replaced in expression, using the format ${variable}, " "variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" -" 2. a color (format: \"color:xxx\")\n" -" 3. an info (format: \"info:name,arguments\", arguments are optional)\n" -" 4. an option (format: \"file.section.option\")\n" -" 5. a local variable in buffer\n" -" 6. a hdata name/variable (the value is automatically converted to string), " +" 2. a string with chars to hide (format: \"hide:char,string\")\n" +" 3. a color (format: \"color:xxx\")\n" +" 4. an info (format: \"info:name,arguments\", arguments are optional)\n" +" 5. an option (format: \"file.section.option\")\n" +" 6. a local variable in buffer\n" +" 7. 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" " hdata.var1.var2...: start with a hdata (pointer must be known), and ask " @@ -1232,23 +1233,24 @@ msgid "" "function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" -" /eval -n ${info:version} ==> 0.4.3\n" -" /eval -n ${weechat.look.scroll_amount} ==> 3\n" -" /eval -n ${window} ==> 0x2549aa0\n" -" /eval -n ${window.buffer} ==> 0x2549320\n" -" /eval -n ${window.buffer.full_name} ==> core.weechat\n" -" /eval -n ${window.buffer.number} ==> 1\n" -" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${info:version} ==> 0.4.3\n" +" /eval -n ${weechat.look.scroll_amount} ==> 3\n" +" /eval -n ${window} ==> 0x2549aa0\n" +" /eval -n ${window.buffer} ==> 0x2549320\n" +" /eval -n ${window.buffer.full_name} ==> core.weechat\n" +" /eval -n ${window.buffer.number} ==> 1\n" +" /eval -n ${\\t} ==> <tab>\n" +" /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" -" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" -" /eval -n -c ${window.win_width} > 100 ==> 1\n" -" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" -" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" -" /eval -n -c abcd =~ ^ABC ==> 1\n" -" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" -" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" -" /eval -n -c abcd !~ abc ==> 0" +" /eval -n -c ${window.buffer.number} > 2 ==> 0\n" +" /eval -n -c ${window.win_width} > 100 ==> 1\n" +" /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" +" /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" +" /eval -n -c abcd =~ ^ABC ==> 1\n" +" /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" +" /eval -n -c abcd =~ (?-i)^abc ==> 1\n" +" /eval -n -c abcd !~ abc ==> 0" msgstr "" msgid "" diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 2d20ba499..8d12aeea0 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -7192,12 +7192,13 @@ command_init () "Some variables are replaced in expression, using the format " "${variable}, variable can be, by order of priority:\n" " 1. a string with escaped chars (format: \"esc:xxx\" or \"\\xxx\")\n" - " 2. a color (format: \"color:xxx\")\n" - " 3. an info (format: \"info:name,arguments\", arguments are " + " 2. a string with chars to hide (format: \"hide:char,string\")\n" + " 3. a color (format: \"color:xxx\")\n" + " 4. an info (format: \"info:name,arguments\", arguments are " "optional)\n" - " 4. an option (format: \"file.section.option\")\n" - " 5. a local variable in buffer\n" - " 6. a hdata name/variable (the value is automatically converted " + " 5. an option (format: \"file.section.option\")\n" + " 6. a local variable in buffer\n" + " 7. 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" @@ -7213,23 +7214,24 @@ command_init () "reference\", function \"weechat_hdata_get\".\n" "\n" "Examples (simple strings):\n" - " /eval -n ${info:version} ==> 0.4.3\n" - " /eval -n ${weechat.look.scroll_amount} ==> 3\n" - " /eval -n ${window} ==> 0x2549aa0\n" - " /eval -n ${window.buffer} ==> 0x2549320\n" - " /eval -n ${window.buffer.full_name} ==> core.weechat\n" - " /eval -n ${window.buffer.number} ==> 1\n" - " /eval -n ${\\t} ==> <tab>\n" + " /eval -n ${info:version} ==> 0.4.3\n" + " /eval -n ${weechat.look.scroll_amount} ==> 3\n" + " /eval -n ${window} ==> 0x2549aa0\n" + " /eval -n ${window.buffer} ==> 0x2549320\n" + " /eval -n ${window.buffer.full_name} ==> core.weechat\n" + " /eval -n ${window.buffer.number} ==> 1\n" + " /eval -n ${\\t} ==> <tab>\n" + " /eval -n ${hide:-,${relay.network.password}} ==> --------\n" "\n" "Examples (conditions):\n" - " /eval -n -c ${window.buffer.number} > 2 ==> 0\n" - " /eval -n -c ${window.win_width} > 100 ==> 1\n" - " /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" - " /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" - " /eval -n -c abcd =~ ^ABC ==> 1\n" - " /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" - " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" - " /eval -n -c abcd !~ abc ==> 0"), + " /eval -n -c ${window.buffer.number} > 2 ==> 0\n" + " /eval -n -c ${window.win_width} > 100 ==> 1\n" + " /eval -n -c (8 > 12) || (5 > 2) ==> 1\n" + " /eval -n -c (8 > 12) && (5 > 2) ==> 0\n" + " /eval -n -c abcd =~ ^ABC ==> 1\n" + " /eval -n -c abcd =~ (?-i)^ABC ==> 0\n" + " /eval -n -c abcd =~ (?-i)^abc ==> 1\n" + " /eval -n -c abcd !~ abc ==> 0"), "-n|-c -n|-c", &command_eval, NULL); hook_command ( diff --git a/src/core/wee-eval.c b/src/core/wee-eval.c index d008420ec..061a41263 100644 --- a/src/core/wee-eval.c +++ b/src/core/wee-eval.c @@ -35,6 +35,7 @@ #include "wee-hook.h" #include "wee-secure.h" #include "wee-string.h" +#include "wee-utf8.h" #include "../gui/gui-buffer.h" #include "../gui/gui-color.h" #include "../gui/gui-window.h" @@ -238,10 +239,11 @@ eval_replace_vars_cb (void *data, const char *text) struct t_config_option *ptr_option; struct t_gui_buffer *ptr_buffer; char str_value[64], *value, *pos, *pos1, *pos2, *hdata_name, *list_name; - char *tmp, *info_name; - const char *ptr_value, *ptr_arguments; + char *tmp, *info_name, *hide_char, *hidden_string; + const char *ptr_value, *ptr_arguments, *ptr_string; struct t_hdata *hdata; void *pointer; + int i, length_hide_char, length, index; pointers = (struct t_hashtable *)(((void **)data)[0]); extra_vars = (struct t_hashtable *)(((void **)data)[1]); @@ -260,14 +262,44 @@ eval_replace_vars_cb (void *data, const char *text) if ((text[0] == '\\') && text[1] && (text[1] != '\\')) return string_convert_escaped_chars (text); - /* 3. look for a color */ + /* 3. hide chars: replace all chars by a given char */ + if (strncmp (text, "hide:", 5) == 0) + { + hidden_string = NULL; + ptr_string = strchr (text + 5, + (text[5] == ',') ? ';' : ','); + if (!ptr_string) + return strdup (""); + hide_char = string_strndup (text + 5, ptr_string - text - 5); + if (hide_char) + { + length_hide_char = strlen (hide_char); + length = utf8_strlen (ptr_string + 1); + hidden_string = malloc ((length * length_hide_char) + 1); + if (hidden_string) + { + index = 0; + for (i = 0; i < length; i++) + { + memcpy (hidden_string + index, hide_char, + length_hide_char); + index += length_hide_char; + } + hidden_string[length * length_hide_char] = '\0'; + } + free (hide_char); + } + return (hidden_string) ? hidden_string : strdup (""); + } + + /* 4. look for a color */ if (strncmp (text, "color:", 6) == 0) { ptr_value = gui_color_get_custom (text + 6); return strdup ((ptr_value) ? ptr_value : ""); } - /* 4. look for an info */ + /* 5. look for an info */ if (strncmp (text, "info:", 5) == 0) { ptr_value = NULL; @@ -287,7 +319,7 @@ eval_replace_vars_cb (void *data, const char *text) return strdup ((ptr_value) ? ptr_value : ""); } - /* 5. look for name of option: if found, return this value */ + /* 6. look for name of option: if found, return this value */ if (strncmp (text, "sec.data.", 9) == 0) { ptr_value = hashtable_get (secure_hashtable_data, text + 9); @@ -320,7 +352,7 @@ eval_replace_vars_cb (void *data, const char *text) } } - /* 6. look for local variable in buffer */ + /* 7. look for local variable in buffer */ ptr_buffer = hashtable_get (pointers, "buffer"); if (ptr_buffer) { @@ -329,7 +361,7 @@ eval_replace_vars_cb (void *data, const char *text) return strdup (ptr_value); } - /* 7. look for hdata */ + /* 8. look for hdata */ value = NULL; hdata_name = NULL; list_name = NULL; diff --git a/tests/unit/core/test-eval.cpp b/tests/unit/core/test-eval.cpp index 98757a8a6..d8d3d52b5 100644 --- a/tests/unit/core/test-eval.cpp +++ b/tests/unit/core/test-eval.cpp @@ -28,6 +28,7 @@ extern "C" #include "src/core/wee-config.h" #include "src/core/wee-hashtable.h" #include "src/core/wee-version.h" +#include "src/gui/gui-color.h" #include "src/plugins/plugin.h" } @@ -182,6 +183,8 @@ TEST(Eval, EvalExpression) CHECK(extra_vars); POINTERS_EQUAL(NULL, eval_expression (NULL, NULL, NULL, NULL)); + + /* test with simple strings */ WEE_CHECK_EVAL("", ""); WEE_CHECK_EVAL("a b c", "a b c"); WEE_CHECK_EVAL("$", "$"); @@ -189,8 +192,32 @@ TEST(Eval, EvalExpression) WEE_CHECK_EVAL("}", "}"); WEE_CHECK_EVAL("", "${}"); WEE_CHECK_EVAL("", "${xyz}"); + + /* test value from extra_vars */ + WEE_CHECK_EVAL("value", "${test}"); + + /* test escaped chars */ WEE_CHECK_EVAL("\t", "${\\t}"); + WEE_CHECK_EVAL("\t", "${esc:\t}"); + + /* test hidden chars */ + WEE_CHECK_EVAL("********", "${hide:*,password}"); + WEE_CHECK_EVAL("\u2603\u2603\u2603", "${hide:${esc:\u2603},abc}"); + + /* test color */ + WEE_CHECK_EVAL(gui_color_get_custom ("green"), "${color:green}"); + WEE_CHECK_EVAL(gui_color_get_custom ("*214"), "${color:*214}"); + + /* test info */ WEE_CHECK_EVAL(version_get_version (), "${info:version}"); + + /* test option */ + snprintf (str_value, sizeof (str_value), + "%d", CONFIG_INTEGER(config_look_scroll_amount)); + WEE_CHECK_EVAL(str_value, "${weechat.look.scroll_amount}"); + WEE_CHECK_EVAL(str_value, "${${window.buffer.name}.look.scroll_amount}"); + + /* test hdata */ WEE_CHECK_EVAL("x", "x${buffer.number"); WEE_CHECK_EVAL("x${buffer.number}1", "x\\${buffer.number}${buffer.number}"); @@ -198,12 +225,6 @@ TEST(Eval, EvalExpression) WEE_CHECK_EVAL("1", "${window.buffer.number}"); WEE_CHECK_EVAL("core.weechat", "${buffer.full_name}"); WEE_CHECK_EVAL("core.weechat", "${window.buffer.full_name}"); - snprintf (str_value, sizeof (str_value), - "%d", CONFIG_INTEGER(config_look_scroll_amount)); - WEE_CHECK_EVAL(str_value, "${weechat.look.scroll_amount}"); - - /* test nested variables */ - WEE_CHECK_EVAL(str_value, "${${window.buffer.name}.look.scroll_amount}"); hashtable_free (extra_vars); } |