I'm using the Slim PHP micro framework with Twig and the translation extension i18n.
I have a need to output translated country names, and would prefer to do it using the translation extension rather than building an array and fetching the name manually in PHP.
So I tried this in my Twig template:
{% set country="trans-country-name("~isoCountryCode~")" %}
{% trans %}
This is a list of all the numbers in {{country}}.
{% endtrans %}
and this in my .po
file:
msgid "This is a list of all the numbers in %country%."
msgstr "Detta är en lista över samtliga nummer i %country%."
msgid "trans-country-name(NO)"
msgstr "Norge"
I was hoping that this would result in
"Detta är en lista över samtliga nummer i Norge."
but instead I just get
"Detta är en lista över samtliga nummer i trans-country-name(NO)."
Is it possible to have the translation extension parse trans-country-name(NO)
as text to be translated?