{% extends '@WebProfiler/Collector/translation.html.twig' %} {# # Authors Tobias Nyholm, Damien Alexandre (damienalexandre), Damien Harper #} {% import _self as translation_helper %} {% block panelContent %}

Translation Metrics

Synchronize all translations
{{ 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 key, message in collector.messages %} {% if message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_DEFINED') %} {% set messages_defined = messages_defined|merge({(key): message}) %} {% elseif message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING') %} {% set messages_missing = messages_missing|merge({(key): message}) %} {% elseif message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK') %} {% set messages_fallback = messages_fallback|merge({(key): message}) %} {% endif %} {% endfor %}

Defined {{ messages_defined|length }}

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 %} {{ translation_helper.render_table(messages_defined) }} {% endif %}

Fallback {{ messages_fallback|length }}

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 %} {{ translation_helper.render_table(messages_fallback) }} {% endif %}

Missing {{ messages_missing|length }}

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 %} {{ translation_helper.render_table(messages_missing) }} {% endif %}
{% include "HappyrTranslationBundle:Profiler:javascripts.html.twig" %} {% endblock %} {% macro render_table(messages) %} {% for key, message in messages %} {% endfor %}
Locale Domain Times used Message ID Message Preview Actions
{% if message.state == constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING') %} {% else %} {% endif %} {{ message.locale }} {{ message.domain }} {{ message.count }} {{ message.id }} {# message.transChoiceNumber is not defined before symfony 2.8.0 #} {% if message.transChoiceNumber is defined and message.transChoiceNumber is not null %} (pluralization is used) {% endif %} {# message.parameters is not defined before symfony 2.8.0 #} {% if message.parameters is defined and message.parameters|length > 0 %} {% endif %} {{ message.translation }} {% spaceless %} Edit | Flag | Sync {% endspaceless %}
{% endmacro %}