605a5674a8
* 5.1: fix merge fix merge Remove branch-version (keep them for contracts only) [HttpClient] relax auth bearer format requirements [PHPUnitBridge] Silence errors from mkdir() [DependencyInjection] Preload classes with union types correctly. [Serializer] fix decoding float XML attributes starting with 0 add missing dutch translations [TwigBridge] Remove "transchoice" from the code base Support PHPUnit 8 and PHPUnit 9 in constraint compatibility trait Add expectDeprecation, expectNotice, expectWarning, and expectError to TestCase polyfill [String] fix before/after[Last]() returning the empty string instead of the original one on non-match Add missing exporter function for PHPUnit 7 [Validator] Add missing romanian translations [String] fix slicing in UnicodeString [Cache] Use correct expiry in ChainAdapter do not translate null placeholders or titles |
||
---|---|---|
.. | ||
Catalogue | ||
Command | ||
DataCollector | ||
DependencyInjection | ||
Dumper | ||
Exception | ||
Extractor | ||
Formatter | ||
Loader | ||
Reader | ||
Resources | ||
Tests | ||
Util | ||
Writer | ||
.gitattributes | ||
.gitignore | ||
CHANGELOG.md | ||
composer.json | ||
DataCollectorTranslator.php | ||
IdentityTranslator.php | ||
LICENSE | ||
LoggingTranslator.php | ||
MessageCatalogue.php | ||
MessageCatalogueInterface.php | ||
MetadataAwareInterface.php | ||
phpunit.xml.dist | ||
PseudoLocalizationTranslator.php | ||
README.md | ||
TranslatableMessage.php | ||
Translator.php | ||
TranslatorBagInterface.php |
Translation Component
The Translation component provides tools to internationalize your application.
Getting Started
$ composer require symfony/translation
use Symfony\Component\Translation\Translator;
$translator = new Translator('fr_FR');
$translator->addResource('array', [
'Hello World!' => 'Bonjour !',
], 'fr_FR');
echo $translator->trans('Hello World!'); // outputs « Bonjour ! »