1

This seems like a hard question to ask, but here goes.

I am using: Slim2 / Twig / Symfony Translation

My lang file has:

['billdata' =>
    [
        '0' => 'EU Basic',
        '1' => 'USA',
        '2' => 'internal'
    ]
]

Then, I need a loop in my template. {{plan.alias}} is the "1","2" so on, in the lang file. If I write {{billdata.1|trans}} it works. How do I get the "plan.alias" into that so it runs through translation engine? {{billdata.alias|trans}}

Zagonine
  • 2,213
  • 3
  • 22
  • 29
TDawg
  • 833
  • 2
  • 8
  • 24

1 Answers1

0

I found this, after trying tens of suggestions: How to concatenate strings in twig

the answer seems to be: {{ ('billdata' ~ plan.alias) | trans }}

Community
  • 1
  • 1
TDawg
  • 833
  • 2
  • 8
  • 24