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