I have a twig file and a yml in which i define the variables for translation, For ex. :
YML File -
variable.for.translation: Disponible, para tí
Content of Twig File -
<h2>"Hola, Follow {{ variableName }} en Twitter</h2>
I wanted to make a variable for
Hola, Follow {{ variableName }} en Twitter
in translation file (i.e my yml file).
Currently i am doing it like this :
In YML -
follow.us.twitter: Hola, Follow
follow.us.twitter1: en Twitter
In Twig -
<h2>{{ "follow.us.twitter"|trans([], "workend") }} {{ variableName }} {{ "follow.us.twitter1"|trans([], "workend") }}</h2>
Its working fine, but the problem is that i now have 3 variables in a twig which are too much :
1. follow.us.twitter
2. follow.us.twitter1
3. {{ variableName }}
I tried to do it with 1 variable like :
follow.us.in.twitter : Hola, Follow {{ variableName }} en Twitter
and
<h2>{{ "follow.us.in.twitter"|trans([], "workend") }}</h2>
but it didn't worked the problem is the variable i.e {{ variableName }} i am using.
Is there any way to do handle a predefined variable and define it in translation file??
Thanks for your time.