ss 33d2a96cf2 初始化 8 月之前
..
Catalogue 33d2a96cf2 初始化 8 月之前
Command 33d2a96cf2 初始化 8 月之前
DataCollector 33d2a96cf2 初始化 8 月之前
DependencyInjection 33d2a96cf2 初始化 8 月之前
Dumper 33d2a96cf2 初始化 8 月之前
Exception 33d2a96cf2 初始化 8 月之前
Extractor 33d2a96cf2 初始化 8 月之前
Formatter 33d2a96cf2 初始化 8 月之前
Loader 33d2a96cf2 初始化 8 月之前
Reader 33d2a96cf2 初始化 8 月之前
Resources 33d2a96cf2 初始化 8 月之前
Util 33d2a96cf2 初始化 8 月之前
Writer 33d2a96cf2 初始化 8 月之前
CHANGELOG.md 33d2a96cf2 初始化 8 月之前
DataCollectorTranslator.php 33d2a96cf2 初始化 8 月之前
IdentityTranslator.php 33d2a96cf2 初始化 8 月之前
Interval.php 33d2a96cf2 初始化 8 月之前
LICENSE 33d2a96cf2 初始化 8 月之前
LoggingTranslator.php 33d2a96cf2 初始化 8 月之前
MessageCatalogue.php 33d2a96cf2 初始化 8 月之前
MessageCatalogueInterface.php 33d2a96cf2 初始化 8 月之前
MessageSelector.php 33d2a96cf2 初始化 8 月之前
MetadataAwareInterface.php 33d2a96cf2 初始化 8 月之前
PluralizationRules.php 33d2a96cf2 初始化 8 月之前
README.md 33d2a96cf2 初始化 8 月之前
Translator.php 33d2a96cf2 初始化 8 月之前
TranslatorBagInterface.php 33d2a96cf2 初始化 8 月之前
TranslatorInterface.php 33d2a96cf2 初始化 8 月之前
composer.json 33d2a96cf2 初始化 8 月之前

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