No Description

server 52763dedf1 gitignore 2 years ago
..
Catalogue 52763dedf1 gitignore 2 years ago
Command 52763dedf1 gitignore 2 years ago
DataCollector 52763dedf1 gitignore 2 years ago
DependencyInjection 52763dedf1 gitignore 2 years ago
Dumper 52763dedf1 gitignore 2 years ago
Exception 52763dedf1 gitignore 2 years ago
Extractor 52763dedf1 gitignore 2 years ago
Formatter 52763dedf1 gitignore 2 years ago
Loader 52763dedf1 gitignore 2 years ago
Reader 52763dedf1 gitignore 2 years ago
Resources 52763dedf1 gitignore 2 years ago
Util 52763dedf1 gitignore 2 years ago
Writer 52763dedf1 gitignore 2 years ago
CHANGELOG.md 52763dedf1 gitignore 2 years ago
DataCollectorTranslator.php 52763dedf1 gitignore 2 years ago
IdentityTranslator.php 52763dedf1 gitignore 2 years ago
Interval.php 52763dedf1 gitignore 2 years ago
LICENSE 52763dedf1 gitignore 2 years ago
LoggingTranslator.php 52763dedf1 gitignore 2 years ago
MessageCatalogue.php 52763dedf1 gitignore 2 years ago
MessageCatalogueInterface.php 52763dedf1 gitignore 2 years ago
MessageSelector.php 52763dedf1 gitignore 2 years ago
MetadataAwareInterface.php 52763dedf1 gitignore 2 years ago
PluralizationRules.php 52763dedf1 gitignore 2 years ago
README.md 52763dedf1 gitignore 2 years ago
Translator.php 52763dedf1 gitignore 2 years ago
TranslatorBagInterface.php 52763dedf1 gitignore 2 years ago
TranslatorInterface.php 52763dedf1 gitignore 2 years ago
composer.json 52763dedf1 gitignore 2 years 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