Skip to content

Commit

Permalink
bug #33010 [TwigBridge] pass translation parameters to the trans filt…
Browse files Browse the repository at this point in the history
…er (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
  • Loading branch information
nicolas-grekas committed Aug 7, 2019
2 parents 381c995 + daac024 commit b406466
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
{%- endif -%}
{%- endif -%}
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
{{- widget|raw }} {{ label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
</label>
{%- endif -%}
{%- endblock checkbox_radio_label %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@

{{ widget|raw }}
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans({}, translation_domain)) -}}
{{- label is not same as(false) ? (translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain)) -}}
{{- form_errors(form) -}}
</label>
{%- endif -%}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
{% endif %}
<label{% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
{{ widget|raw }}
{{ translation_domain is same as(false) ? label : label|trans({}, translation_domain) }}
{{ translation_domain is same as(false) ? label : label|trans(label_translation_parameters, translation_domain) }}
</label>
{%- endblock checkbox_radio_label %}

Expand Down

0 comments on commit b406466

Please sign in to comment.