ss 394472f036 init 7 月之前
..
Catalogue 394472f036 init 7 月之前
Command 394472f036 init 7 月之前
DataCollector 394472f036 init 7 月之前
DependencyInjection 394472f036 init 7 月之前
Dumper 394472f036 init 7 月之前
Exception 394472f036 init 7 月之前
Extractor 394472f036 init 7 月之前
Formatter 394472f036 init 7 月之前
Loader 394472f036 init 7 月之前
Reader 394472f036 init 7 月之前
Resources 394472f036 init 7 月之前
Util 394472f036 init 7 月之前
Writer 394472f036 init 7 月之前
CHANGELOG.md 394472f036 init 7 月之前
DataCollectorTranslator.php 394472f036 init 7 月之前
IdentityTranslator.php 394472f036 init 7 月之前
Interval.php 394472f036 init 7 月之前
LICENSE 394472f036 init 7 月之前
LoggingTranslator.php 394472f036 init 7 月之前
MessageCatalogue.php 394472f036 init 7 月之前
MessageCatalogueInterface.php 394472f036 init 7 月之前
MessageSelector.php 394472f036 init 7 月之前
MetadataAwareInterface.php 394472f036 init 7 月之前
PluralizationRules.php 394472f036 init 7 月之前
README.md 394472f036 init 7 月之前
Translator.php 394472f036 init 7 月之前
TranslatorBagInterface.php 394472f036 init 7 月之前
TranslatorInterface.php 394472f036 init 7 月之前
composer.json 394472f036 init 7 月之前

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