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

[Translation] Added intl message formatter.#20007

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

Closed
aitboudad wants to merge1 commit intosymfony:masterfromaitboudad:intl-formatter

Conversation

@aitboudad
Copy link
Contributor

QA
Branch?master
Bug fix?no
New feature?yes
BC breaks?no
Deprecations?no
Tests pass?yes
Fixed tickets~
LicenseMIT
Doc PR~

Related to#18314

Koc, sstok, mathroc, and danrot reacted with hooray emoji
),
array(
'4,560 monkeys on 123 trees make 37.073 monkeys per tree',
'{0,number,integer} monkeys on {1,number,integer} trees make {2,number} monkeys per tree',
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the point inMessageFormatter abstraction if at the end you are coupled with specific implementation?

@Koc
Copy link
Contributor

Koc commentedSep 21, 2016

ref#10671,#10152,#6009

@fabpot
Copy link
Member

This only makes sense if we support the plurals as well.

@MatTheCat
Copy link
Contributor

This seems abandoned, does this mean we'll have to add anIntlMessageFormatter ourselves in order to use\MessageFormatter?

@nicolas-grekas
Copy link
Member

Moving to 4.1. Rebase on master needed, where PHP 7.1 features can be used btw.

@nicolas-grekasnicolas-grekas modified the milestones:3.4,4.1Oct 8, 2017
@stof
Copy link
Member

stof commentedMar 9, 2018

The issue with the PR in its current state is that it creates a community split: as soon as you configure Symfony to use the intl formatter in your project, it becomes incompatible with all bundles written using the default formatter (and this includes translations shipped in the core for validation errors). This makes it impossible to use it in a gradual way.

@sstok
Copy link
Contributor

sstok commentedMar 11, 2018
edited
Loading

@stof indeed 😞 I guess the only way to resolve this is adding an extra argument to the trans method (CustomTransformerTranslatorInterface with an overwrite of trans() to add an additional argument) 🤔 not the nicest way but at least it would make is possible to use the new Transformer without breaking BC.

And we can't add a flag to a translation file because YAML and PHP for example use a hash at the root level, plus making@format_transformer a special key feels a bit strange 😛 and would still require a proper solution for XLIFF.

@stof
Copy link
Member

@sstok requiring codeusing the translations to provide the formatter to use to format this message looks really weird, because it puts this info in the wrong place. The template doing a translation calls has no idea which formatter implementation the original file was written for.

This only makes sense if we support the plurals as well.

The ICU message format supports pluralization based on any parameter (and on multiple ones), as this is one of the available features inside the string. We don't need a specifictransChoice feature in this case (which is an API limited to a single integer being the pluralization source)

@aitboudad
Copy link
ContributorAuthor

I think grouping messages by formatter would solve the issue, something likedomain part.
I haven't yet to time to investigate on it, so if anyone interested on it would be welcomed 😄

@MatTheCat
Copy link
Contributor

Couldn't we make intl mandatory for Symfony 5? 😌

sstok reacted with thumbs up emojisstok reacted with laugh emoji

@fabpot
Copy link
Member

Closing in favor of#27399

@fabpotfabpot closed thisJun 10, 2018
@aitboudadaitboudad deleted the intl-formatter branchJune 10, 2018 10:07
fabpot added a commit that referenced this pull requestSep 4, 2018
…, Nyholm)This PR was merged into the 4.2-dev branch.Discussion----------[Translation] Added intl message formatter.| Q             | A| ------------- | ---| Branch?       | master| Bug fix?      | no| New feature?  | yes| BC breaks?    | no| Deprecations? | no| Tests pass?   | yes| Fixed tickets | replaces#20007| License       | MIT| Doc PR        |This PR will replace#20007 and continue the work from the original author.I've have tried to address all comments made in the original PR.Commits-------2a90931 csfb30c77 Be more specific with what exception we catchb1aa004 Only use the default translator if intl extension is loadedf88153f Updates according to feedback597a15d Use FallbackFormatter instead of support for multiple formatters2aa7181 Fixes according to feedbacka325a44 Allow config for different domain specific formattersb43fe21 Add support for multiple formattersc2b3dc0 [Translation] Added intl message formatter.19e8e69 use error940d440 Make it a warning
@nicolas-grekasnicolas-grekas modified the milestones:next,4.2Nov 1, 2018
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

1 more reviewer

@unkindunkindunkind left review comments

Reviewers whose approvals may not affect merge requirements

Assignees

No one assigned

Projects

None yet

Milestone

4.2

Development

Successfully merging this pull request may close these issues.

9 participants

@aitboudad@Koc@fabpot@MatTheCat@nicolas-grekas@stof@sstok@unkind@carsonbot

[8]ページ先頭

©2009-2025 Movatter.jp