8000 Update bootstrap_4_layout.html.twig · symfony/symfony@a8e9a40 · GitHub
[go: up one dir, main page]

Skip to content

Commit a8e9a40

Browse files
authored
Update bootstrap_4_layout.html.twig
1 parent 0f21718 commit a8e9a40

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

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

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@
123123
{%- set type = type|default('file') -%}
124124
{{- block('form_widget_simple') -}}
125125
{%- set label_attr = label_attr|merge({ class: (label_attr.class|default('') ~ ' custom-file-label')|trim }) -%}
126-
<label for="{{ form.vars.id }}" lang="{{ app.request.locale }}" {% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
126+
{%- set input_lang = 'en' -%}
127+
{% if app is defined and app.request is defined %}{%- set input_lang = app.request.locale -%}{%- endif -%}
128+
<label for="{{ form.vars.id }}" lang="{{ input_lang }}" {% with { attr: label_attr } %}{{ block('attributes') }}{% endwith %}>
127129
{%- if attr.placeholder is defined and attr.placeholder is not none -%}
128130
{{- translation_domain is same as(false) ? attr.placeholder : attr.placeholder|trans({}, translation_domain) -}}
129131
{%- endif -%}

0 commit comments

Comments
 (0)
0