Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Translation] SimpleIntlMessageFormatter for users with no icu extension #28492

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

Closed
wants to merge 1 commit into from

Conversation

Nyholm
Copy link
Member

@Nyholm Nyholm commented Sep 17, 2018

Q A
Branch? master
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets
License MIT
Doc PR comming

In #27399 we added a IntlMessageFormatter. That only works for users with icu extension installed. Here is a simple implementation of a IntlMessageFormatter. It does not use the icu extension. It is (obviously) not feature complete. I've also chosen to not do it locale specific.

namespace Symfony\Component\Translation\Formatter;

/**
* A Polyfill for IntlMessageFormatter for users that do not have the icu extension installed.
Copy link
Contributor

@jvasseur jvasseur Sep 17, 2018

Choose a reason for hiding this comment

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

Would it be possible to provide a polyfill for the MessageFormatter class as part of the Intl component (or the intl polyfill) instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

I thought about that and I’m not sure I did the correct decision.

The reason why I did not do a polyfill is because I have no intension of being feature complete. There is massive amount of exceptions that you have to consider when supporting multiple languages. Ie number formats and to figure out what “few” means in all languages.

@nicolas-grekas
Copy link
Member

I submitted symfony/polyfill#148 instead, would be a better approach IMHO :)

@Nyholm
Copy link
Member Author

Nyholm commented Sep 21, 2018

Thank you

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

Successfully merging this pull request may close these issues.

4 participants