Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Form Labels translation does not allow raw content (Add label_html option) #35598

Closed
MihaiBwr opened this issue Feb 5, 2020 · 6 comments
Closed
Milestone

Comments

@MihaiBwr
Copy link

MihaiBwr commented Feb 5, 2020

Description
Based on this PR: #28635
I am trying to do the following:

->add('confirmedAgb', CheckboxType::class, [
                'label' => 'some.label',
                'label_translation_parameters' => [
                    '%start_link%' => '<a href="https://www.de" target="_blank">',
                    '%end_link' => '</a>'
                ],
            ])

but the result is

<a href="https://www.de" target="_blank"> link </a> here

This function is great but it's missing this important piece.
Thanks.

@javiereguiluz javiereguiluz added this to the next milestone Feb 5, 2020
@javiereguiluz
Copy link
Member

I've missed this feature in the past too (specially in complex checkboxes/radiobuttons which contain a mult-line content to include a description + some help with HTML contents). I missed this in the help attribute too ... but we added help_html option to fix this ... so we may add a label_html option too.

@przemyslaw-bogusz
Copy link
Contributor

I have prepared a PR for this #31375. Here is how it looks for a label on CheckboxType, depending if you set label_html to false or true.

Zrzut ekranu 2020-02-9 o 17 43 05

It is even recognizable by Symfony plugin in Phpstorm.

Zrzut ekranu 2020-02-9 o 17 43 34

@javiereguiluz The only problem is I have a red light from Travis CI on PHP 7.4.

@ThomasLandauer
Copy link
Contributor

Related issue #8733

Is it possible to rename this issue to "Add label_html option"? I was just about to open a new one ;-)

Regarding the actual feature: Whatever the arguments were for implementing help_html - they certainly apply to label_html as well :-)

@xabbuh
Copy link
Member

xabbuh commented Apr 18, 2020

Looks like we forgot to close here after merging #31375. :)

About the option name: I am not convinced that choosing something else would be a good idea given that it currently follows the same naming convention as the previously added help_html option.

@xabbuh xabbuh closed this as completed Apr 18, 2020
@ThomasLandauer
Copy link
Contributor

ThomasLandauer commented Apr 18, 2020

@xabbuh I wanted to rename this issue title, not the option ;-)

@xabbuh xabbuh changed the title Form Labels translation does not allow raw content Form Labels translation does not allow raw content (Add label_html option) Apr 18, 2020
@xabbuh
Copy link
Member

xabbuh commented Apr 18, 2020

I misunderstood your comment and added the addition to the title. :)

@nicolas-grekas nicolas-grekas modified the milestones: next, 5.1 May 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants