You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
zenglingping
85f826c35f
|
3 years ago | |
---|---|---|
.. | ||
Catalogue | 3 years ago | |
Command | 3 years ago | |
DataCollector | 3 years ago | |
DependencyInjection | 3 years ago | |
Dumper | 3 years ago | |
Exception | 3 years ago | |
Extractor | 3 years ago | |
Formatter | 3 years ago | |
Loader | 3 years ago | |
Provider | 3 years ago | |
Reader | 3 years ago | |
Resources | 3 years ago | |
Test | 3 years ago | |
Util | 3 years ago | |
Writer | 3 years ago | |
CHANGELOG.md | 3 years ago | |
DataCollectorTranslator.php | 3 years ago | |
IdentityTranslator.php | 3 years ago | |
LICENSE | 3 years ago | |
LoggingTranslator.php | 3 years ago | |
MessageCatalogue.php | 3 years ago | |
MessageCatalogueInterface.php | 3 years ago | |
MetadataAwareInterface.php | 3 years ago | |
PseudoLocalizationTranslator.php | 3 years ago | |
README.md | 3 years ago | |
TranslatableMessage.php | 3 years ago | |
Translator.php | 3 years ago | |
TranslatorBag.php | 3 years ago | |
TranslatorBagInterface.php | 3 years ago | |
composer.json | 3 years ago |
README.md
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 ! »