Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[TwigBridge] Fix HTML for translatable custom-file label in Bootstrap 4 theme#40980

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
nicolas-grekas merged 1 commit intosymfony:5.2fromacran:5.2
May 7, 2021

Conversation

@acran
Copy link
Contributor

QA
Branch?5.2
Bug fix?yes
New feature?no
Deprecations?no
Tickets
LicenseMIT
Doc PR

Bootstrap allows to translate/change the label of the upload button of acustom-file input via SCSS, seeBootstrap docs:

$custom-file-text: (en:"Browse",es:"Elegir");

This works by generating the following CSS which depends on thelang attribute of the input:

.custom-file-input:lang(es)~ .custom-file-label::after {content:"Elegir";}

This however currently does not work with the HTML generated by the theme since the resulting HTML is of the form (redacted here to the relevant parts):

<divclass="custom-file"><inputtype="file"id="..."class="custom-file-input"><labelfor="..."lang="es"class="custom-file-label"></label></div>

while it should be of the form

<divclass="custom-file"><inputtype="file"id="..."lang="es"class="custom-file-input"><labelfor="..."class="custom-file-label"></label></div>

i.e. thelang was placed on thelabel instead of theinput.

This PR fixes this to be compatible with Bootstrap 4.

@carsonbot
Copy link

Hey!

To help keep things organized, we don't allow "Draft" pull requests. Could you please click the "ready for review" button or close this PR and open a new one when you are done?

Note that a pull request does not have to be "perfect" or "ready for merge" when you first open it. We just want it to be ready for a first review.

Cheers!

Carsonbot

… 4 themeBootstraps allows to translate the label of the button of a custom-fileinput with SCSS variables depending on the lang attribute of the*input*.This attribute was set on the label instead and thus had no effect.
@nicolas-grekas
Copy link
Member

Thank you@acran.

@nicolas-grekasnicolas-grekas merged commit38a991e intosymfony:5.2May 7, 2021
This was referencedMay 9, 2021
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@stofstofstof left review comments

@nicolas-grekasnicolas-grekasnicolas-grekas approved these changes

Assignees

No one assigned

Projects

None yet

Milestone

5.2

Development

Successfully merging this pull request may close these issues.

4 participants

@acran@carsonbot@nicolas-grekas@stof

[8]ページ先頭

©2009-2025 Movatter.jp