ss d581d78eb7 初始化 | hai 10 meses | |
---|---|---|
.. | ||
Catalogue | hai 10 meses | |
Command | hai 10 meses | |
DataCollector | hai 10 meses | |
DependencyInjection | hai 10 meses | |
Dumper | hai 10 meses | |
Exception | hai 10 meses | |
Extractor | hai 10 meses | |
Formatter | hai 10 meses | |
Loader | hai 10 meses | |
Reader | hai 10 meses | |
Resources | hai 10 meses | |
Util | hai 10 meses | |
Writer | hai 10 meses | |
CHANGELOG.md | hai 10 meses | |
DataCollectorTranslator.php | hai 10 meses | |
IdentityTranslator.php | hai 10 meses | |
Interval.php | hai 10 meses | |
LICENSE | hai 10 meses | |
LoggingTranslator.php | hai 10 meses | |
MessageCatalogue.php | hai 10 meses | |
MessageCatalogueInterface.php | hai 10 meses | |
MessageSelector.php | hai 10 meses | |
MetadataAwareInterface.php | hai 10 meses | |
PluralizationRules.php | hai 10 meses | |
README.md | hai 10 meses | |
Translator.php | hai 10 meses | |
TranslatorBagInterface.php | hai 10 meses | |
TranslatorInterface.php | hai 10 meses | |
composer.json | hai 10 meses |
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 ! »