Using a twig, how can I translate all the elements in an array and connect them to a slash? Do I need to use an additional variable or is there a smarter method?
At the moment I am doing something like this:
{% set labels = [] %} {% for feature in menu_item.features %} {% set labels = labels|merge([feature|trans([], 'features')]) %} {% endfor %} {{ labels | join(' / ')}}
This sucks.
source share