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

Skip to content

[Translation] Use locale_parse for computing fallback locales #35103

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

Merged
merged 1 commit into from
Dec 27, 2019

Conversation

alanpoulain
Copy link
Contributor

Q A
Branch? 3.4
Bug fix? yes
New feature? no
Deprecations? no
Tickets N/A
License MIT
Doc PR N/A

As done in this PR #24157 for the Intl component, the Translation component should use locale_parse as well when available.

It will allow to manage BCP 47 locales, which is why it is considered a bugfix (locale_set_default is using BCP 47 compliant locale).

As done with the forementioned PR, there is also a fallback to make it work with -.

Sadly, I think it will create some conflicts when merging it upstream since the modified code has changed little by little.

@fabpot
Copy link
Member

fabpot commented Dec 27, 2019

Thank you @alanpoulain.

fabpot added a commit that referenced this pull request Dec 27, 2019
…cales (alanpoulain)

This PR was merged into the 3.4 branch.

Discussion
----------

[Translation] Use `locale_parse` for computing fallback locales

| Q             | A
| ------------- | ---
| Branch?       | 3.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | N/A
| License       | MIT
| Doc PR        | N/A

As done in this PR #24157 for the `Intl` component, the `Translation` component should use `locale_parse` as well when available.

It will allow to manage [BCP 47](https://tools.ietf.org/html/bcp47) locales, which is why it is considered a bugfix ([locale_set_default](https://www.php.net/manual/en/locale.setdefault.php) is using BCP 47 compliant locale).

As done with the forementioned PR, there is also a fallback to make it work with `-`.

Sadly, I think it will create some conflicts when merging it upstream since the modified code has changed little by little.

Commits
-------

3657c0e Use locale_parse for computing fallback locales
@fabpot fabpot merged commit 3657c0e into symfony:3.4 Dec 27, 2019
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