{% extends '@WebProfiler/Profiler/layout.html.twig' %} {% import _self as helper %} {% block toolbar %} {% if collector.messages|length %} {% set icon %} {{ include('@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 %}
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 %} {{ include('@WebProfiler/Icon/translation.svg') }} Translation {% if collector.countMissings or collector.countFallbacks %} {% set error_count = collector.countMissings + collector.countFallbacks %} {{ error_count }} {% endif %} {% endblock %} {% block panel %} {% if collector.messages is empty %}

Translations

No translations have been called.

{% else %} {{ block('panelContent') }} {% endif %} {% endblock %} {% block panelContent %}

Translation Metrics

{{ collector.countDefines }} Defined messages
{{ collector.countFallbacks }} Fallback messages
{{ collector.countMissings }} Missing messages

Translation 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 %} {{ helper.render_table(messages_defined) }} {% 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 %} {{ helper.render_table(messages_fallback) }} {% 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 %} {{ helper.render_table(messages_missing) }} {% endif %}
{% endblock %} {% macro render_table(messages) %} {% for message in messages %} {% endfor %}
Locale Domain Times used Message ID Message Preview
{{ message.locale }} {{ 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 %}