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

[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type#28635

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
fabpot merged 1 commit intosymfony:masterfromwebnet-fr:form_translation_parameters_labels_helps
Feb 13, 2019
Merged

Conversation

@webnet-fr
Copy link
Contributor

@webnet-frwebnet-fr commentedSep 28, 2018
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes. Travis-ci isn't green because it tests the components separately. Fabbot.io requires license headers in files where they were not present before.
Fixed tickets#27698
LicenseMIT
Doc PRsymfony/symfony-docs#10065

Hi, this is an alternative to#27775.

translation_parameters is separated tolabel_translation_parameters,help_translation_parameters,attr_translation_parameters.

soullivaneuh, cybernet, and andreybolonin reacted with thumbs up emoji
@webnet-frwebnet-fr changed the titleForm translation parameters labels helps[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form typeSep 28, 2018
@nicolas-grekasnicolas-grekas added this to thenext milestoneSep 29, 2018
@nicolas-grekas
Copy link
Member

Travis-ci isn't green because it tests the components separately

that's the point of the PR, ensuring components are still compatible with each others versions listed in composer.json files. This should be fixed.

@ro0NL
Copy link
Contributor

At some point i'd really like to see aTranslation VO :) this applies to at leastchoice labels as well.

A single value could simplify things a lot:

'label' =>'text','other_label' =>newTranslation('text','domain', ['param' =>'value'],'nl_NL'),'other_other_label' =>newIdentityTranslation('text'),

@webnet-fr
Copy link
ContributorAuthor

@nicolas-grekas, travis CI is actually green whendeps option is not specified. In this case I assume the components changed by this PR are tested together and this test is passed successfully.

On the other hand withdeps=high composer installssymfony/form (4.2.x-dev) while withdeps=low it usessymfony/form (v4.1.0). Correct me if I am wrong but integrity tests of different versions of components (Form,FrameworkBudle,DoctineBridge,TwigBridge) cannot pass and it is normal.

@webnet-fr
Copy link
ContributorAuthor

webnet-fr commentedOct 1, 2018
edited
Loading

Hi@ro0NL. There is always a way to acheive desired result in Symfony, that's why we love it :)
In your example we need to get current locale which is not convenient IMO:

'other_label' =>newTranslation('text','domain', ['param' =>'value'],$request->getLocale()),

@ro0NL
Copy link
Contributor

ro0NL commentedOct 1, 2018
edited
Loading

Those would be all nullable (except $text), as its purpose would be to override defaults

@xabbuh
Copy link
Member

@webnet-fr Those tests ensure that Symfony 4.1 components will work with dependencies in version 4.2. This is a bit hard for the form theme tests though as they almost do 1:1 comparisons of the generated HTML. We also struggle with that in#27043 for example. So we need to look how we can relax assertions in 4.1 a bit to reduce the pain here.

@webnet-fr
Copy link
ContributorAuthor

@xabbuh I movedhelp_translation_parameters toFormType. Anyway personally I'd prefer#27775.

Yes, I completely agree that form tests are tricky especially when tesing transverse changes.

@soullivaneuh
Copy link
Contributor

Well even if I'm sure of my review, I'm less sure@carsonbot should listen to me. 😉

@xabbuh
Copy link
Member

Thedeps=high job will pass once the PR is merged.

Copy link
Member

@xabbuhxabbuh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

The changes look good to me.

@webnet-fr Can you add an entry to the changelog file of the Form component to mention the new options?

@webnet-fr
Copy link
ContributorAuthor

@xabbuh I've updated changelog.

I will correct documentation PR shortly.

xabbuh and althaus reacted with thumbs up emoji

@webnet-fr
Copy link
ContributorAuthor

Documentation is updted.symfony/symfony-docs#10065

xabbuh reacted with thumbs up emoji

…and attr_translation_parameters options to base form type
@fabpot
Copy link
Member

Thank you@webnet-fr.

@fabpotfabpot merged commitb3f3c53 intosymfony:masterFeb 13, 2019
fabpot added a commit that referenced this pull requestFeb 13, 2019
…ion_parameters and attr_translation_parameters options to base form type (webnet-fr)This PR was squashed before being merged into the 4.3-dev branch (closes#28635).Discussion----------[Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes. Travis-ci isn't green because it tests the components separately. Fabbot.io requires license headers in files where they were not present before.| Fixed tickets |#27698| License       | MIT| Doc PR        |symfony/symfony-docs#10065Hi, this is an alternative to#27775.`translation_parameters` is separated to `label_translation_parameters`, `help_translation_parameters`, `attr_translation_parameters`.Commits-------b3f3c53 [Form] Add label_translation_parameters, help_translation_parameters and attr_translation_parameters options to base form type
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestMar 6, 2019
…dyslav Riabchenko)This PR was merged into the master branch.Discussion----------[Form] New translation_parameters optionDocumentingsymfony/symfony#28635Commits-------20c6f5a correct arrays short syntax70f36ad correct bugd7e7b0b correct attr link in entity type doc71fc7ce typo in form_translation_parameters docsa655106 confirm with 2863532e79e1 correct link errorc57d30a new translation_parameters form option
@nicolas-grekasnicolas-grekas modified the milestones:next,4.3Apr 30, 2019
@fabpotfabpot mentioned this pull requestMay 9, 2019
@MihaiBwr
Copy link

How can I make this raw? Does not seem to be such an option. the html_help => true does not help in this situation. Thanks.

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

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

+1 more reviewer

@soullivaneuhsoullivaneuhsoullivaneuh approved these changes

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.3

Development

Successfully merging this pull request may close these issues.

8 participants

@webnet-fr@nicolas-grekas@ro0NL@xabbuh@soullivaneuh@fabpot@MihaiBwr@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp