This repository has been archived on 2023-08-20. You can view files and clone it, but cannot push or open issues or pull requests.
symfony/src/Symfony/Component/Translation
Fabien Potencier 9cc80ecd75 feature #28070 [Translator] Use ICU parent locales as fallback locales (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        | https://github.com/symfony/symfony-docs/pull/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
2018-08-28 08:30:53 +02:00
..
Catalogue Merge branch '2.8' into 3.4 2018-07-26 11:06:28 +02:00
Command Merge branch '4.1' 2018-08-08 09:59:30 +02:00
DataCollector Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
DependencyInjection Merge branch '3.4' into 4.0 2018-07-26 11:08:35 +02:00
Dumper Merge branch '4.0' into 4.1 2018-07-26 11:10:45 +02:00
Exception Revert "feature #26702 Mark ExceptionInterfaces throwable (ostrolucky)" 2018-05-30 09:26:09 +02:00
Extractor Merge branch '3.4' into 4.0 2018-07-26 10:51:09 +02:00
Formatter [Translation] Support adding custom message formatter 2017-09-12 13:17:01 +01:00
Loader [Translation] dedup XSD files 2018-08-07 14:26:01 +02:00
Reader Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
Resources feature #28070 [Translator] Use ICU parent locales as fallback locales (thewilkybarkid) 2018-08-28 08:30:53 +02:00
Tests [Translator] Use ICU parent locales as fallback locales 2018-08-28 08:30:46 +02:00
Util [Translation] dedup XSD files 2018-08-07 14:26:01 +02:00
Writer Merge branch '4.0' into 4.1 2018-07-26 11:10:45 +02:00
.gitignore
CHANGELOG.md [Translator] Use ICU parent locales as fallback locales 2018-08-28 08:30:46 +02:00
composer.json updated version to 4.2 2018-05-07 16:51:25 +02:00
DataCollectorTranslator.php Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
IdentityTranslator.php removed useless PHPDoc 2017-09-30 07:00:23 -07:00
Interval.php [Translation] added Base Exception for the component. 2016-09-21 18:16:56 +01:00
LICENSE fixed years in copyright 2018-01-03 08:23:28 +01:00
LoggingTranslator.php Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
MessageCatalogue.php Replace more docblocks by type-hints 2017-11-07 15:45:01 +01:00
MessageCatalogueInterface.php fixed CS 2018-05-16 14:49:49 +02:00
MessageSelector.php Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
MetadataAwareInterface.php Fix doc blocks 2014-04-18 22:17:16 +02:00
phpunit.xml.dist fail when detecting risky tests 2017-04-12 09:39:27 +02:00
PluralizationRules.php Merge branch '2.8' into 3.4 2018-07-26 10:45:46 +02:00
README.md Updated all the README files 2016-03-04 08:12:06 +01:00
Translator.php [Translator] Use ICU parent locales as fallback locales 2018-08-28 08:30:46 +02:00
TranslatorBagInterface.php Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00
TranslatorInterface.php Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00

Translation Component

The Translation component provides tools to internationalize your application.

Resources