Kirin 93a3391a21 init | 1 rok pred | |
---|---|---|
.. | ||
Catalogue | 1 rok pred | |
Command | 1 rok pred | |
DataCollector | 1 rok pred | |
DependencyInjection | 1 rok pred | |
Dumper | 1 rok pred | |
Exception | 1 rok pred | |
Extractor | 1 rok pred | |
Formatter | 1 rok pred | |
Loader | 1 rok pred | |
Provider | 1 rok pred | |
Reader | 1 rok pred | |
Resources | 1 rok pred | |
Test | 1 rok pred | |
Util | 1 rok pred | |
Writer | 1 rok pred | |
CHANGELOG.md | 1 rok pred | |
DataCollectorTranslator.php | 1 rok pred | |
IdentityTranslator.php | 1 rok pred | |
LICENSE | 1 rok pred | |
LoggingTranslator.php | 1 rok pred | |
MessageCatalogue.php | 1 rok pred | |
MessageCatalogueInterface.php | 1 rok pred | |
MetadataAwareInterface.php | 1 rok pred | |
PseudoLocalizationTranslator.php | 1 rok pred | |
README.md | 1 rok pred | |
TranslatableMessage.php | 1 rok pred | |
Translator.php | 1 rok pred | |
TranslatorBag.php | 1 rok pred | |
TranslatorBagInterface.php | 1 rok pred | |
composer.json | 1 rok pred |
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 ! »
The Translation component for Symfony 5.4/6.0 is backed by:
Help Symfony by sponsoring its development!