Skip to content

Commit 3526d23

Browse files
committed
minor symfony#22163 [WebProfilerBundle] Include badge status in translation tabs (ro0NL)
This PR was merged into the 3.2 branch. Discussion ---------- [WebProfilerBundle] Include badge status in translation tabs | Q | A | ------------- | --- | Branch? | 3.2 | Bug fix? | yes-ish | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #... <!-- #-prefixed issue number(s), if any --> | License | MIT | Doc PR | symfony/symfony-docs#... <!--highly recommended for new features--> Minor consistency fix for the translation panel. Tab badges should indicate a certain status (at least the logs panel does as of 3.2). But for the missing translations (being the last tab) i think this is a good signal. And we could argue _defined_ fallback messages should really indicate a warning.. Before ![image](https://cloud.githubusercontent.com/assets/1047696/24331093/8d9b1210-122d-11e7-9403-a5a86548b214.png) After ![image](https://cloud.githubusercontent.com/assets/1047696/24331104/bf2800b8-122d-11e7-92ea-57b2664e869f.png) Funny sidenote; the log warning is about a missing translation 😅 Commits ------- 543ac43 [WebProfilerBundle] Include badge status in translation tabs
2 parents b1bfbcc + 543ac43 commit 3526d23

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/Symfony/Bundle/WebProfilerBundle/Resources/views/Collector/translation.html.twig

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
{{ include('@WebProfiler/Icon/translation.svg') }}
99
{% set status_color = collector.countMissings ? 'red' : collector.countFallbacks ? 'yellow' %}
1010
{% set error_count = collector.countMissings + collector.countFallbacks %}
11-
<span class="sf-toolbar-value">{{ error_count ?: collector.countdefines }}</span>
11+
<span class="sf-toolbar-value">{{ error_count ?: collector.countDefines }}</span>
1212
{% endset %}
1313

1414
{% set text %}
@@ -28,7 +28,7 @@
2828

2929
<div class="sf-toolbar-info-piece">
3030
<b>Defined messages</b>
31-
<span class="sf-toolbar-status">{{ collector.countdefines }}</span>
31+
<span class="sf-toolbar-status">{{ collector.countDefines }}</span>
3232
</div>
3333
{% endset %}
3434

@@ -65,7 +65,7 @@
6565

6666
<div class="metrics">
6767
<div class="metric">
68-
<span class="value">{{ collector.countdefines }}</span>
68+
<span class="value">{{ collector.countDefines }}</span>
6969
<span class="label">Defined messages</span>
7070
</div>
7171

@@ -96,7 +96,7 @@
9696

9797
<div class="sf-tabs">
9898
<div class="tab">
99-
<h3 class="tab-title">Defined <span class="badge">{{ messages_defined|length }}</span></h3>
99+
<h3 class="tab-title">Defined <span class="badge">{{ collector.countDefines }}</span></h3>
100100

101101
<div class="tab-content">
102102
<p class="help">
@@ -114,7 +114,7 @@
114114
</div>
115115

116116
<div class="tab">
117-
<h3 class="tab-title">Fallback <span class="badge">{{ messages_fallback|length }}</span></h3>
117+
<h3 class="tab-title">Fallback <span class="badge {{ collector.countFallbacks ? 'status-warning' }}">{{ collector.countFallbacks }}</span></h3>
118118

119119
<div class="tab-content">
120120
<p class="help">
@@ -133,7 +133,7 @@
133133
</div>
134134

135135
<div class="tab">
136-
<h3 class="tab-title">Missing <span class="badge">{{ messages_missing|length }}</span></h3>
136+
<h3 class="tab-title">Missing <span class="badge {{ collector.countMissings ? 'status-error' }}">{{ collector.countMissings }}</span></h3>
137137

138138
<div class="tab-content">
139139
<p class="help">

0 commit comments

Comments
 (0)