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