Setting translation_domain inside the if statement would cause the variable to not be setted if the on_top option is true.
@@ -25,8 +25,8 @@
{% block linkElement %}
{% spaceless %}
+ {% set translation_domain = item.extra('translation_domain', 'messages') %}
{% if item.extra('on_top') is defined and not item.extra('on_top') %}
- {% set translation_domain = item.extra('translation_domain', 'messages') %}
{% set icon = item.extra('icon')|default(item.level > 1 ? '<i class="fa fa-angle-double-right" aria-hidden="true"></i>' : '') %}
{% else %}
{% set icon = item.extra('icon') %}