Dmitriy Gnatenko 2c154caeca Vendors updated | 3 years ago | |
---|---|---|
.. | ||
Catalogue | 3 years ago | |
Command | 3 years ago | |
DataCollector | 3 years ago | |
DependencyInjection | 3 years ago | |
Dumper | 3 years ago | |
Exception | 4 years ago | |
Extractor | 3 years ago | |
Formatter | 4 years ago | |
Loader | 3 years ago | |
Reader | 4 years ago | |
Resources | 3 years ago | |
Util | 3 years ago | |
Writer | 4 years ago | |
CHANGELOG.md | 3 years ago | |
DataCollectorTranslator.php | 3 years ago | |
IdentityTranslator.php | 4 years ago | |
LICENSE | 3 years ago | |
LoggingTranslator.php | 4 years ago | |
MessageCatalogue.php | 3 years ago | |
MessageCatalogueInterface.php | 3 years ago | |
MetadataAwareInterface.php | 4 years ago | |
PluralizationRules.php | 3 years ago | |
PseudoLocalizationTranslator.php | 3 years ago | |
README.md | 3 years ago | |
TranslatableMessage.php | 3 years ago | |
Translator.php | 3 years ago | |
TranslatorBagInterface.php | 4 years ago | |
composer.json | 3 years ago |
The Translation component provides tools to internationalize your application.
$ 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 ! »