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
Nicolas Grekas 4b8983aef5 bug #39887 [Translator] fix handling plural for floating numbers (kylekatarnls)
This PR was squashed before being merged into the 4.4 branch.

Discussion
----------

[Translator] fix handling plural for floating numbers

| Q             | A
| ------------- | ---
| Branch?       | 4.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Tickets       | Fix #30215
| License       | MIT

Commits
-------

533cd7ef6c [Translator] fix handling plural for floating numbers
2021-01-26 10:08:00 +01:00
..
Catalogue Merge branch '3.4' into 4.4 2020-03-16 09:56:54 +01:00
Command Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
DataCollector CS: Apply ternary_to_null_coalescing fixer 2020-12-27 00:49:32 +01:00
DependencyInjection Use short array deconstruction syntax. 2020-10-28 21:42:29 +01:00
Dumper CS fix 2021-01-14 16:08:15 +01:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Extractor Apply "visibility_required" CS rule to constants 2020-12-08 17:59:59 +01:00
Formatter Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
Loader Use ::class keyword when possible 2021-01-11 09:57:50 +01:00
Reader Remove unneeded phpdocs 2019-08-08 11:37:48 +02:00
Resources Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
Tests [Translator] fix handling plural for floating numbers 2021-01-26 10:07:54 +01:00
Util [DependencyInjection][Translator] Silent deprecation triggered by libxml_disable_entity_loader 2020-11-27 07:35:49 +01:00
Writer Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
.gitattributes add missing gitattributes for phpunit-bridge 2020-03-27 17:54:36 +01:00
.gitignore Added missing files .gitignore 2013-07-21 14:12:18 +02:00
CHANGELOG.md Deprecate things that prevent \Throwable from bubbling down 2019-11-05 18:23:20 +01:00
composer.json Improve composer.json descriptions 2021-01-10 17:25:35 +01:00
DataCollectorTranslator.php Apply "visibility_required" CS rule to constants 2020-12-08 17:59:59 +01:00
IdentityTranslator.php [Translator] fix handling plural for floating numbers 2021-01-26 10:07:54 +01:00
Interval.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
LICENSE Bump license year 2021-01-01 10:24:35 +01:00
LoggingTranslator.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
MessageCatalogue.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
MessageCatalogueInterface.php Apply "visibility_required" CS rule to constants 2020-12-08 17:59:59 +01:00
MessageSelector.php Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
MetadataAwareInterface.php Fix doc blocks 2014-04-18 22:17:16 +02:00
phpunit.xml.dist Bump phpunit XSD version to 5.2 2018-11-11 12:18:13 +01:00
PluralizationRules.php [Translator] fix handling plural for floating numbers 2021-01-26 10:07:54 +01:00
README.md Added $translator->addLoader() 2021-01-19 21:09:23 +05:00
Translator.php [Translator] Optional Intl dependency 2020-09-24 11:40:01 +02:00
TranslatorBagInterface.php Adding use statement for InvalidArgumentException 2017-03-03 07:24:16 -08:00
TranslatorInterface.php Merge branch '4.1' into 4.2 2019-01-16 21:31:39 +01:00

Translation Component

The Translation component provides tools to internationalize your application.

Getting Started

$ composer require symfony/translation
use Symfony\Component\Translation\Translator;
use Symfony\Component\Translation\Loader\ArrayLoader;

$translator = new Translator('fr_FR');
$translator->addLoader('array', new ArrayLoader());
$translator->addResource('array', [
    'Hello World!' => 'Bonjour !',
], 'fr_FR');

echo $translator->trans('Hello World!'); // outputs « Bonjour ! »

Resources