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