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