[Profiler][Translation] added filter.
This commit is contained in:
parent
5f36605e0e
commit
65f92916a2
@ -57,6 +57,14 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
{% block panelContent %}
|
{% block panelContent %}
|
||||||
|
{% set filter = request.query.get('state', '-1') %}
|
||||||
|
{% set filterOptions = {
|
||||||
|
'-1': '',
|
||||||
|
(constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_DEFINED')): 'Defined messages',
|
||||||
|
(constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_MISSING')): 'Missing messages',
|
||||||
|
(constant('Symfony\\Component\\Translation\\DataCollectorTranslator::MESSAGE_EQUALS_FALLBACK')): 'Fallback messages',
|
||||||
|
} %}
|
||||||
|
|
||||||
<h2>Translation Stats</h2>
|
<h2>Translation Stats</h2>
|
||||||
<table>
|
<table>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -72,6 +80,22 @@
|
|||||||
<th>Missing messages</th>
|
<th>Missing messages</th>
|
||||||
<td><pre>{{ collector.countMissings }}</pre></td>
|
<td><pre>{{ collector.countMissings }}</pre></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<th>Filter</th>
|
||||||
|
<td>
|
||||||
|
<form id="filter-form" action="" method="get" style="display: inline">
|
||||||
|
<input type="hidden" name="panel" value="translation">
|
||||||
|
<select id="filter" name="state" onchange="document.getElementById('filter-form').submit(); ">
|
||||||
|
{% for key,option in filterOptions %}
|
||||||
|
<option value="{{ key }}"{{ filter == key ? ' selected' : '' }}>{{ option }}</option>
|
||||||
|
{% endfor %}
|
||||||
|
</select>
|
||||||
|
<noscript>
|
||||||
|
<input type="submit" value="refresh">
|
||||||
|
</noscript>
|
||||||
|
</form>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
@ -83,7 +107,7 @@
|
|||||||
<th>Id</th>
|
<th>Id</th>
|
||||||
<th>Message Preview</th>
|
<th>Message Preview</th>
|
||||||
</tr>
|
</tr>
|
||||||
{% for message in collector.messages %}
|
{% for message in collector.messages if message.state == filter or filter == '-1' %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><code>{{ translator.state(message) }}</code></td>
|
<td><code>{{ translator.state(message) }}</code></td>
|
||||||
<td><code>{{ message.locale }}</code></td>
|
<td><code>{{ message.locale }}</code></td>
|
||||||
|
Reference in New Issue
Block a user