Skip to content

Commit b406466

Browse files
bug #33010 [TwigBridge] pass translation parameters to the trans filter (xabbuh)
This PR was merged into the 4.3 branch. Discussion ---------- [TwigBridge] pass translation parameters to the trans filter | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | | License | MIT | Doc PR | This was reported by @voltel on the Symfony Slack. Commits ------- daac024 pass translation parameters to the trans filter
2 parents 381c995 + daac024 commit b406466

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_3_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
{%- endif -%}
100100
{%- endif -%}
101101
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
102-
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
102+
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
103103
</label>
104104
{%- endif -%}
105105
{%- endblock checkbox_radio_label %}

src/Symfony/Bridge/Twig/Resources/views/Form/bootstrap_4_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266

267267
{{ widget|raw }}
268268
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
269-
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
269+
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
270270
{{- form_errors(form) -}}
271271
</label>
272272
{%- endif -%}

src/Symfony/Bridge/Twig/Resources/views/Form/foundation_5_layout.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@
266266
{% endif %}
267267
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
268268
{{ widget|raw }}
269-
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
269+
{{ translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain) }}
270270
</label>
271271
{%- endblock checkbox_radio_label %}
272272

0 commit comments

Comments
 (0)