feature #29780 [Profiler] Still show locale and fallback locale even if no trans used (ogizanagi)
This PR was squashed before being merged into the 4.3-dev branch (closes #29780).
Discussion
----------
[Profiler] Still show locale and fallback locale even if no trans used
| Q | A
| ------------- | ---
| Branch? | master <!-- see below -->
| Bug fix? | no
| New feature? | yes <!-- don't forget to update src/**/CHANGELOG.md files -->
| BC breaks? | no <!-- see https://symfony.com/bc -->
| Deprecations? | no <!-- don't forget to update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tests pass? | yes <!-- please add some, will be required by reviewers -->
| Fixed tickets | N/A <!-- #-prefixed issue number(s), if any -->
| License | MIT
| Doc PR | N/A
Even if no translation is used for the current request, this information can still be valuable and displayed in the panel.
### Before
![capture d ecran 2019-01-04 a 18 03 03](https://user-images.githubusercontent.com/2211145/50701531-6933b280-104e-11e9-87a9-1f22ddfd7dc5.png)
### After
![capture d ecran 2019-01-04 a 18 01 06](https://user-images.githubusercontent.com/2211145/50701539-718bed80-104e-11e9-8293-388e9c6ee240.png)
and with messages, move locales info first:
![capture d ecran 2019-01-04 a 18 01 18](https://user-images.githubusercontent.com/2211145/50701593-96806080-104e-11e9-835e-1f207f720616.png)
Actually, following metrics are redundant with the tabs count. Not convinced we should duplicate it.
Edit: removed
---
Note we also collect the locale set into the request from the `RequestDataCollector`, but we never use it. Should we display it somewhere in the request panel?
Commits
-------
d80bfad54e
[Profiler] Still show locale and fallback locale even if no trans used
This commit is contained in:
commit
2fcb367583
@ -56,38 +56,9 @@
|
||||
{% endblock %}
|
||||
|
||||
{% block panel %}
|
||||
{% if collector.messages is empty %}
|
||||
<h2>Translations</h2>
|
||||
<div class="empty">
|
||||
<p>No translations have been called.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
{{ block('panelContent') }}
|
||||
{% endif %}
|
||||
{% endblock %}
|
||||
|
||||
{% block panelContent %}
|
||||
|
||||
<h2>Translation</h2>
|
||||
|
||||
<div class="metrics">
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.countDefines }}</span>
|
||||
<span class="label">Defined messages</span>
|
||||
</div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.countFallbacks }}</span>
|
||||
<span class="label">Fallback messages</span>
|
||||
</div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.countMissings }}</span>
|
||||
<span class="label">Missing messages</span>
|
||||
</div>
|
||||
|
||||
<div class="metric-divider"></div>
|
||||
|
||||
<div class="metric">
|
||||
<span class="value">{{ collector.locale|default('-') }}</span>
|
||||
<span class="label">Locale</span>
|
||||
@ -100,6 +71,11 @@
|
||||
|
||||
<h2>Messages</h2>
|
||||
|
||||
{% if collector.messages is empty %}
|
||||
<div class="empty">
|
||||
<p>No translations have been called.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
{% block messages %}
|
||||
|
||||
{# sort translation messages in groups #}
|
||||
@ -182,6 +158,7 @@
|
||||
<script>Sfjs.createFilters();</script>
|
||||
|
||||
{% endblock messages %}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
Reference in New Issue
Block a user