唐金木 07e2592bdb first commit | 4 years ago | |
---|---|---|
.. | ||
Catalogue | 4 years ago | |
Command | 4 years ago | |
DataCollector | 4 years ago | |
DependencyInjection | 4 years ago | |
Dumper | 4 years ago | |
Exception | 4 years ago | |
Extractor | 4 years ago | |
Formatter | 4 years ago | |
Loader | 4 years ago | |
Reader | 4 years ago | |
Resources | 4 years ago | |
Util | 4 years ago | |
Writer | 4 years ago | |
.gitattributes | 4 years ago | |
CHANGELOG.md | 4 years ago | |
DataCollectorTranslator.php | 4 years ago | |
IdentityTranslator.php | 4 years ago | |
LICENSE | 4 years ago | |
LoggingTranslator.php | 4 years ago | |
MessageCatalogue.php | 4 years ago | |
MessageCatalogueInterface.php | 4 years ago | |
MetadataAwareInterface.php | 4 years ago | |
README.md | 4 years ago | |
Translator.php | 4 years ago | |
TranslatorBagInterface.php | 4 years ago | |
composer.json | 4 years ago |
The Translation component provides tools to internationalize your application.
$ 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 ! »