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

Added support for using the "{{ label }}" placeholder in constraint messages#35338

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:masterfroma-menshchikov:feature/12238
Sep 1, 2020

Conversation

a-menshchikov
Copy link
Contributor

@a-menshchikova-menshchikov commentedJan 14, 2020
edited
Loading

QA
Branch?master
Bug fix?no
New feature?yes
Deprecations?no
Tickets#12238
LicenseMIT
Doc PR
  • Add docs PR

@a-menshchikova-menshchikov changed the titleAdded support for using the "{{ label }}" placeholder in constraint messages[WIP] Added support for using the "{{ label }}" placeholder in constraint messagesJan 15, 2020
@a-menshchikov
Copy link
ContributorAuthor

There is no support forlabel_format yet. I have no idea about how get%id% substitution value inViolationMapper.

@nicolas-grekasnicolas-grekas added this to thenext milestoneJan 17, 2020
@nicolas-grekas
Copy link
Member

nicolas-grekas commentedJan 17, 2020
edited
Loading

I think this would need some examples - via tests maybe. Reviewing I'm wondering e.g. why doesn't the message go through translation? Why do we use str_replace instead of "label" as a translation variable? Should translating the label be done before or after humanize() by form? etc. All these may become more obvious with examples.

@a-menshchikov
Copy link
ContributorAuthor

a-menshchikov commentedJan 17, 2020
edited
Loading

Why doesn't the message go through translation?

Message into violation object already translated.

Why do we use str_replace instead of "label" as a translation variable?

Since the message has already been translated, it makes no sense to translate it one more time with{{ label }} parameter. IMO str_replace is quite enough. (But maybe I'm not taking something into account.)

Should translating the label be done before or after humanize() by form?

There I've repeated translation logic fromform_div_layout.html.twig because we want to get the same label as it rendered on form.

@a-menshchikov
Copy link
ContributorAuthor

Maybe placeholder should be%label% for consistence with substitutions format inlabel_format widget option?

@a-menshchikov
Copy link
ContributorAuthor

@nicolas-grekas what can I do to bring the review closer?

@YaFou
Copy link
Contributor

Any news on this pull request?

@a-menshchikova-menshchikovforce-pushed thefeature/12238 branch 2 times, most recently from01b14fd to47b92d4CompareAugust 22, 2020 08:30
@a-menshchikov
Copy link
ContributorAuthor

@nicolas-grekas@xabbuh PR rebased on master and ready for review.

@a-menshchikova-menshchikovforce-pushed thefeature/12238 branch 2 times, most recently from32267a1 toff9bc3fCompareAugust 26, 2020 13:57
@fabpot
Copy link
Member

@xabbuh Could you review this PR?

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.

Just one minor comment. Apart from that the PR looks very good. 👍

@xabbuhxabbuh added the Form labelSep 1, 2020
@xabbuhxabbuh changed the title[WIP] Added support for using the "{{ label }}" placeholder in constraint messagesAdded support for using the "{{ label }}" placeholder in constraint messagesSep 1, 2020
@fabpot
Copy link
Member

Thank you@a-menshchikov.

@fabpot
Copy link
Member

@a-menshchikov Can you submit a PR for the docs?

@fabpotfabpot merged commitccfc4ba intosymfony:masterSep 1, 2020
@a-menshchikova-menshchikov deleted the feature/12238 branchSeptember 2, 2020 22:25
javiereguiluz added a commit to symfony/symfony-docs that referenced this pull requestSep 3, 2020
… constraint messages (a-menshchikov)This PR was squashed before being merged into the master branch.Discussion----------Added support for using the "{{ label }}" placeholder in constraint messagesDocs forsymfony/symfony#35338Commits-------e298929 Added support for using the "{{ label }}" placeholder in constraint messages
@nicolas-grekasnicolas-grekas modified the milestones:next,5.2Oct 5, 2020
@fabpotfabpot mentioned this pull requestOct 5, 2020
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@KocalKocalKocal left review comments

@fabpotfabpotfabpot approved these changes

@xabbuhxabbuhxabbuh approved these changes

@nicolas-grekasnicolas-grekasAwaiting requested review from nicolas-grekas

Assignees
No one assigned
Projects
None yet
Milestone
5.2
Development

Successfully merging this pull request may close these issues.

7 participants
@a-menshchikov@nicolas-grekas@YaFou@fabpot@xabbuh@Kocal@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp