I was wondering if is there any way to loop to such a struct with Twig:
{%
set languages = [
{"english": "en"},
{"spanish": "es"},
{"italian": "it"},
{"german": "de"},
{"french": "fr"},
{"portuguese": "pt"},
]
%}
{% for value in languages %}
Language: {{value.??}} - Locale: {{value.??}}
{% endfor %}
I don't like to split object in a "key value" pair just to have properties named... any way to achieve this?
In the meanwhile I modified the struct as follows to use a simple key value looping:
{%
set languages = {
"english": "en",
"spanish": "es",
"italian": "it",
"german": "de",
"french": "fr",
"portuguese": "pt"
}
%}