Skip to content

Update translator fallback example to include ICU parents #10122

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 2 commits into from
Sep 4, 2018

Conversation

thewilkybarkid
Copy link
Contributor

Changes the example to show symfony/symfony#28070.

@javiereguiluz javiereguiluz added Translation Waiting Code Merge Docs for features pending to be merged labels Jul 27, 2018
symfony-splitter pushed a commit to symfony/translation that referenced this pull request Aug 28, 2018
…s (thewilkybarkid)

This PR was squashed before being merged into the 4.2-dev branch (closes #28070).

Discussion
----------

[Translator] Use ICU parent locales as fallback locales

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12319
| License       | MIT
| Doc PR        | symfony/symfony-docs#10122

Currently the `Translator` fall backs based on the locale separator (eg `es_AR` to `es`), but the ICU data contains parent locales (eg `es_AR` is a child of `es_419`, as is `es_BO`, `es_EC` etc).

This makes use of the ICU data to add add in these fallbacks. This means the specific locales can be used, but the translations can stored in these groupings (eg `es_419` for Latin American Spanish), as well as adding other sensible fallbacks (eg Cape Verdean Portuguese to `pt_PT`).

Commits
-------

e0f402fc29 [Translator] Use ICU parent locales as fallback locales
symfony-splitter pushed a commit to symfony/intl that referenced this pull request Aug 28, 2018
…s (thewilkybarkid)

This PR was squashed before being merged into the 4.2-dev branch (closes #28070).

Discussion
----------

[Translator] Use ICU parent locales as fallback locales

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12319
| License       | MIT
| Doc PR        | symfony/symfony-docs#10122

Currently the `Translator` fall backs based on the locale separator (eg `es_AR` to `es`), but the ICU data contains parent locales (eg `es_AR` is a child of `es_419`, as is `es_BO`, `es_EC` etc).

This makes use of the ICU data to add add in these fallbacks. This means the specific locales can be used, but the translations can stored in these groupings (eg `es_419` for Latin American Spanish), as well as adding other sensible fallbacks (eg Cape Verdean Portuguese to `pt_PT`).

Commits
-------

e0f402fc29 [Translator] Use ICU parent locales as fallback locales
fabpot added a commit to symfony/symfony that referenced this pull request Aug 28, 2018
…s (thewilkybarkid)

This PR was squashed before being merged into the 4.2-dev branch (closes #28070).

Discussion
----------

[Translator] Use ICU parent locales as fallback locales

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12319
| License       | MIT
| Doc PR        | symfony/symfony-docs#10122

Currently the `Translator` fall backs based on the locale separator (eg `es_AR` to `es`), but the ICU data contains parent locales (eg `es_AR` is a child of `es_419`, as is `es_BO`, `es_EC` etc).

This makes use of the ICU data to add add in these fallbacks. This means the specific locales can be used, but the translations can stored in these groupings (eg `es_419` for Latin American Spanish), as well as adding other sensible fallbacks (eg Cape Verdean Portuguese to `pt_PT`).

Commits
-------

e0f402f [Translator] Use ICU parent locales as fallback locales
@javiereguiluz javiereguiluz added Status: Reviewed and removed Status: Needs Review Waiting Code Merge Docs for features pending to be merged labels Sep 4, 2018
@javiereguiluz javiereguiluz added this to the 4.2 milestone Sep 4, 2018
@javiereguiluz
Copy link
Member

javiereguiluz commented Sep 4, 2018

@thewilkybarkid a very nice feature! Thanks for contributing it, including the doc update!

@javiereguiluz javiereguiluz merged commit 7ccf603 into symfony:master Sep 4, 2018
javiereguiluz added a commit that referenced this pull request Sep 4, 2018
…s (thewilkybarkid, javiereguiluz)

This PR was merged into the master branch.

Discussion
----------

Update translator fallback example to include ICU parents

Changes the example to show symfony/symfony#28070.

Commits
-------

7ccf603 Reworded and added the versionadded directive
54631df Update translator fallback example to include ICU parents
@thewilkybarkid thewilkybarkid deleted the icu-parent-locales branch September 4, 2018 13:51
SerhiyMytrovtsiy added a commit to SerhiyMytrovtsiy/translation that referenced this pull request Oct 19, 2022
…s (thewilkybarkid)

This PR was squashed before being merged into the 4.2-dev branch (closes #28070).

Discussion
----------

[Translator] Use ICU parent locales as fallback locales

| Q             | A
| ------------- | ---
| Branch?       | master
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | #12319
| License       | MIT
| Doc PR        | symfony/symfony-docs#10122

Currently the `Translator` fall backs based on the locale separator (eg `es_AR` to `es`), but the ICU data contains parent locales (eg `es_AR` is a child of `es_419`, as is `es_BO`, `es_EC` etc).

This makes use of the ICU data to add add in these fallbacks. This means the specific locales can be used, but the translations can stored in these groupings (eg `es_419` for Latin American Spanish), as well as adding other sensible fallbacks (eg Cape Verdean Portuguese to `pt_PT`).

Commits
-------

e0f402fc29 [Translator] Use ICU parent locales as fallback locales
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.

3 participants