y 6d580e2b69 hooray_1 3 年之前
..
Catalogue 6d580e2b69 hooray_1 3 年之前
Command 6d580e2b69 hooray_1 3 年之前
DataCollector 6d580e2b69 hooray_1 3 年之前
DependencyInjection 6d580e2b69 hooray_1 3 年之前
Dumper 6d580e2b69 hooray_1 3 年之前
Exception 6d580e2b69 hooray_1 3 年之前
Extractor 6d580e2b69 hooray_1 3 年之前
Formatter 6d580e2b69 hooray_1 3 年之前
Loader 6d580e2b69 hooray_1 3 年之前
Reader 6d580e2b69 hooray_1 3 年之前
Resources 6d580e2b69 hooray_1 3 年之前
Util 6d580e2b69 hooray_1 3 年之前
Writer 6d580e2b69 hooray_1 3 年之前
CHANGELOG.md 6d580e2b69 hooray_1 3 年之前
DataCollectorTranslator.php 6d580e2b69 hooray_1 3 年之前
IdentityTranslator.php 6d580e2b69 hooray_1 3 年之前
LICENSE 6d580e2b69 hooray_1 3 年之前
LoggingTranslator.php 6d580e2b69 hooray_1 3 年之前
MessageCatalogue.php 6d580e2b69 hooray_1 3 年之前
MessageCatalogueInterface.php 6d580e2b69 hooray_1 3 年之前
MetadataAwareInterface.php 6d580e2b69 hooray_1 3 年之前
PseudoLocalizationTranslator.php 6d580e2b69 hooray_1 3 年之前
README.md 6d580e2b69 hooray_1 3 年之前
TranslatableMessage.php 6d580e2b69 hooray_1 3 年之前
Translator.php 6d580e2b69 hooray_1 3 年之前
TranslatorBagInterface.php 6d580e2b69 hooray_1 3 年之前
composer.json 6d580e2b69 hooray_1 3 年之前

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