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
2021-03-15 13:54:07 +01:00
..
Catalogue Fixed updating catalogue metadata from intl domain 2021-01-31 21:39:35 -05:00
Command Fix #36973: Command description consistency 2021-03-05 09:58:50 -08: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 [Translation] Make name attribute optional in xliff2 2021-02-24 17:01:00 +01:00
Exception Mark ExceptionInterfaces throwable 2018-08-29 17:58:00 +02:00
Extractor deal with indented heredoc/nowdoc tokens 2021-02-26 14:53:48 +01:00
Formatter Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
Loader Fix: Article 2021-02-14 13:29:41 +01:00
Reader Remove superfluous phpdoc tags 2019-08-14 13:59:53 +02:00
Resources Merge branch '3.4' into 4.4 2020-09-02 18:08:58 +02:00
Tests [Translation] fix test case name 2021-03-15 13:54:07 +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 Fix "provide" declarations 2021-02-06 09:54:26 +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