Commit e0d17ee6 authored by alexpott's avatar alexpott

Issue #2280955 by bdragon, joelpittet | chx: Fix TwigTransTest.

parent b001084e
......@@ -153,8 +153,22 @@ protected function compileString(\Twig_NodeInterface $body) {
$args = $args->getNode('node');
}
if ($args instanceof \Twig_Node_Expression_GetAttr) {
$argName = $args->getNode('attribute')->getAttribute('value');
$expr = $n;
$argName = array();
// Reuse the incoming expression.
$expr = $args;
// Assemble a valid argument name by walking through the expression.
$argName[] = $args->getNode('attribute')->getAttribute('value');
while ($args->hasNode('node')) {
$args = $args->getNode('node');
if ($args instanceof \Twig_Node_Expression_Name) {
$argName[] = $args->getAttribute('name');
}
else {
$argName[] = $args->getNode('attribute')->getAttribute('value');
}
}
$argName = array_reverse($argName);
$argName = implode('.', $argName);
}
else {
$argName = $n->getAttribute('name');
......
......@@ -203,7 +203,7 @@ protected function checkForDebugMarkup($visible) {
'{{ token }}' => '<!-- TRANSLATION: "Escaped: @string" -->',
'{{ token|passthrough }}' => '<!-- TRANSLATION: "Pass-through: !string" -->',
'{{ token|placeholder }}' => '<!-- TRANSLATION: "Placeholder: %string" -->',
'{{ complex.tokens }}' => '<!-- TRANSLATION: "This @name has a length of: @count. It contains: %numbers and @bad_text. Lets pass the bad text through: !bad_text." -->',
'{{ complex.tokens }}' => '<!-- TRANSLATION: "This @token.name has a length of: @count. It contains: %token.numbers and @token.bad_text. Lets pass the bad text through: !token.bad_text." -->',
'{% trans with {"context": "Lolspeak"} %}I have context.{% endtrans %}' => '<!-- TRANSLATION: "I have context.", CONTEXT: "Lolspeak" -->',
'{% trans with {"langcode": "zz"} %}Hello new text.{% endtrans %}' => '<!-- TRANSLATION: "Hello new text.", LANGCODE: "zz" -->',
'{% trans with {"context": "Lolspeak", "langcode": "zz"} %}Hello new text.{% endtrans %}' => '<!-- TRANSLATION: "Hello new text.", CONTEXT: "Lolspeak", LANGCODE: "zz" -->',
......@@ -300,8 +300,8 @@ protected function poFileContents($langcode) {
msgid "Placeholder: %string"
msgstr "PLAYSHOLDR: %string"
msgid "This @name has a length of: @count. It contains: %numbers and @bad_text. Lets pass the bad text through: !bad_text."
msgstr "DIS @name HAZ LENGTH OV: @count. IT CONTAYNZ: %numbers AN @bad_text. LETS PAS TEH BAD TEXT THRU: !bad_text."
msgid "This @token.name has a length of: @count. It contains: %token.numbers and @token.bad_text. Lets pass the bad text through: !token.bad_text."
msgstr "DIS @token.name HAZ LENGTH OV: @count. IT CONTAYNZ: %token.numbers AN @token.bad_text. LETS PAS TEH BAD TEXT THRU: !token.bad_text."
msgctxt "Lolspeak"
msgid "I have context."
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment