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

Resources