I saved my translation data in a database, each line contains a language in the twig template ,i set the variable so
{% if app.request.getLocale()== 'en' %}
{% set language = 1 %}
{%else%}
{% set language = 0 %}
{% endif %}
i use this for display data from database
<p>{{indexpage.0.titpage}}</p>
I wanted to use the variable language to change the display
<p>{{indexpage.language.titpage}}</p>
I have tried it with concatenation and other ways but does not
<p>{{indexpage.~language~.titpage}}</p>
How i can fix this ,thank very much