{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% block toolbar %} {% if collector.messages|length %} {% set icon %} {{ source('@WebProfiler/Icon/translation.svg') }} {% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count ?: collector.countDefines }} {% endset %} {% set text %}
Default locale {{ collector.locale|default('-') }}
Missing messages {{ collector.countMissings }}
Fallback messages {{ collector.countFallbacks }}
Defined messages {{ collector.countDefines }}
{% endset %} {{ include('@WebProfiler/Profiler/toolbar_item.html.twig', { link: profiler_url, status: status_color }) }} {% endif %} {% endblock %} {% block menu %} {{ source('@WebProfiler/Icon/translation.svg') }} Translation {% if collector.countMissings or collector.countFallbacks %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count }} {% endif %} {% endblock %} {% block panel %}

Translation

{{ collector.locale|default('-') }} Default locale
{{ collector.fallbackLocales|join(', ')|default('-') }} Fallback locale{{ collector.fallbackLocales|length != 1 ? 's' }}

Messages

{% if collector.messages is empty %}

No translations have been called.

{% else %} {% block messages %} {# sort translation messages in groups #} {% set messages_defined, messages_missing, messages_fallback = [], [], [] %} {% for message in collector.messages %} {% if message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_DEFINED') %} {% set messages_defined = messages_defined|merge([message]) %} {% elseif message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING') %} {% set messages_missing = messages_missing|merge([message]) %} {% elseif message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK') %} {% set messages_fallback = messages_fallback|merge([message]) %} {% endif %} {% endfor %}

Defined {{ collector.countDefines }}

These messages are correctly translated into the given locale.

{% if messages_defined is empty %}

None of the used translation messages are defined for the given locale.

{% else %} {% block defined_messages %} {{ _self.render_table(messages_defined) }} {% endblock %} {% endif %}

Fallback {{ collector.countFallbacks }}

These messages are not available for the given locale but Symfony found them in the fallback locale catalog.

{% if messages_fallback is empty %}

No fallback translation messages were used.

{% else %} {% block fallback_messages %} {{ _self.render_table(messages_fallback, true) }} {% endblock %} {% endif %}

Missing {{ collector.countMissings }}

These messages are not available for the given locale and cannot be found in the fallback locales. Add them to the translation catalogue to avoid Symfony outputting untranslated contents.

{% if messages_missing is empty %}

There are no messages of this category.

{% else %} {% block missing_messages %} {{ _self.render_table(messages_missing) }} {% endblock %} {% endif %}
{% endblock messages %} {% endif %} {% endblock %} {% macro render_table(messages, is_fallback) %} {% if is_fallback %} {% endif %} {% for message in messages %} {% if is_fallback %} {% endif %} {% endfor %}
LocaleFallback localeDomain Times used Message ID Message Preview
{{ message.locale }}{{ message.fallbackLocale|default('-') }}{{ message.domain }} {{ message.count }} {{ message.id }} {% if message.transChoiceNumber is not null %} (pluralization is used) {% endif %} {% if message.parameters|length > 0 %} {% endif %} {{ message.translation }}
{% endmacro %}