Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fixed trans tag

  • Loading branch information...
commit 560990d47ba3fefea18420f9951b54d490715b19 1 parent 3076c97
Fabien Potencier fabpot authored

Showing 1 changed file with 5 additions and 2 deletions. Show diff stats Hide diff stats

  1. +5 2 lib/Twig/Extensions/Node/Trans.php
7 lib/Twig/Extensions/Node/Trans.php
@@ -100,16 +100,19 @@ public function compile(Twig_Compiler $compiler)
100 100
101 101 protected function compileString(Twig_NodeInterface $body)
102 102 {
103   - if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant) {
  103 + if ($body instanceof Twig_Node_Expression_Name || $body instanceof Twig_Node_Expression_Constant || $body instanceof Twig_Node_Expression_TempName) {
104 104 return array($body, array());
105 105 }
106 106
107 107 $vars = array();
108   -
109 108 if (count($body)) {
110 109 $msg = '';
111 110
112 111 foreach ($body as $node) {
  112 + if (get_class($node) === 'Twig_Node' && $node->getNode(0) instanceof Twig_Node_SetTemp) {
  113 + $node = $node->getNode(1);
  114 + }
  115 +
113 116 if ($node instanceof Twig_Node_Print) {
114 117 $n = $node->getNode('expr');
115 118 while ($n instanceof Twig_Node_Expression_Filter) {

0 comments on commit 560990d

Please sign in to comment.
Something went wrong with that request. Please try again.