Skip to content

Commit

Permalink
[TwigHooks] Remove translations on profiler (#160)
Browse files Browse the repository at this point in the history
On Symfony packages, they do not use translations for profiling pages.
Technical words like those ones are hard to maintain and currently, we
have keys instead of translations on fr, it, de...

Before

![image](https://github.com/user-attachments/assets/b1cdb6a3-aa3b-4a80-8a50-941bdfb51298)

![image](https://github.com/user-attachments/assets/16c4d547-424c-4c0b-bf28-0f63cdb7a806)
  • Loading branch information
loic425 authored Dec 12, 2024
2 parents 28cbf9b + ab29238 commit ca61287
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 22 deletions.
1 change: 0 additions & 1 deletion src/TwigHooks/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
"symfony/dotenv": "^6.4 || ^7.0",
"symfony/framework-bundle": "^6.4 || ^7.0",
"symfony/runtime": "^6.4 || ^7.0",
"symfony/translation": "^6.4 || ^7.0",
"symfony/twig-bundle": "^6.4 || ^7.0",
"symfony/web-profiler-bundle": "^6.4 || ^7.0",
"symfony/yaml": "^6.4 || ^7.0",
Expand Down
18 changes: 9 additions & 9 deletions src/TwigHooks/templates/data_collector/hooks.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@

<div class="sf-toolbar-info">
<div class="sf-toolbar-info-piece">
<b>{{ 'sylius_twig_hooks.profiler.metrics.render_time'|trans }}</b>
<b>Render time</b>
<span>{{ collector.totalDuration }} ms</span>
</div>
<div class="sf-toolbar-info-piece">
<b>{{ 'sylius_twig_hooks.profiler.metrics.rendered_hooks'|trans }}</b>
<b>Hooks</b>
<span class="sf-toolbar-status">{{ collector.numberOfHooks }}</span>
</div>
<div class="sf-toolbar-info-piece">
<b>{{ 'sylius_twig_hooks.profiler.metrics.rendered_hookables'|trans }}</b>
<b>Hookables</b>
<span class="sf-toolbar-status">{{ collector.numberOfHookables }}</span>
</div>
</div>
Expand All @@ -58,31 +58,31 @@
<span class="icon">
{{ include('@SyliusTwigHooks/data_collector/icon.svg') }}
</span>
<strong>{{ 'sylius_twig_hooks.profiler.menu.title'|trans }}</strong>
<strong>Twig Hooks</strong>
</span>
{% endblock %}

{% block panel %}
<h2>{{ 'sylius_twig_hooks.profiler.metrics.title'|trans }}</h2>
<h2>Twig Hooks Metrics</h2>

<div class="metrics">
<div class="metric">
<span class="value">{{ collector.totalDuration }} <span class="unit">ms</span></span>
<span class="label">{{ 'sylius_twig_hooks.profiler.metrics.total_execution_time'|trans }}</span>
<span class="label">Total execution time</span>
</div>

<div class="metric">
<span class="value">{{ collector.numberOfHooks }}</span>
<span class="label">{{ 'sylius_twig_hooks.profiler.metrics.rendered_hooks'|trans }}</span>
<span class="label">Hooks</span>
</div>

<div class="metric">
<span class="value">{{ collector.numberOfHookables }}</span>
<span class="label">{{ 'sylius_twig_hooks.profiler.metrics.rendered_hookables'|trans }}</span>
<span class="label">Hookables</span>
</div>
</div>

<h2>{{ 'sylius_twig_hooks.profiler.call_graph.title'|trans }}</h2>
<h2>Call Graph</h2>

<div id="twig-dump">
{{ collector.callGraph }}
Expand Down
12 changes: 0 additions & 12 deletions src/TwigHooks/translations/messages.en.yaml

This file was deleted.

0 comments on commit ca61287

Please sign in to comment.