Musa 4547782a4a first commit 1 year ago
..
Catalogue 4547782a4a first commit 1 year ago
Command 4547782a4a first commit 1 year ago
DataCollector 4547782a4a first commit 1 year ago
DependencyInjection 4547782a4a first commit 1 year ago
Dumper 4547782a4a first commit 1 year ago
Exception 4547782a4a first commit 1 year ago
Extractor 4547782a4a first commit 1 year ago
Formatter 4547782a4a first commit 1 year ago
Loader 4547782a4a first commit 1 year ago
Provider 4547782a4a first commit 1 year ago
Reader 4547782a4a first commit 1 year ago
Resources 4547782a4a first commit 1 year ago
Test 4547782a4a first commit 1 year ago
Util 4547782a4a first commit 1 year ago
Writer 4547782a4a first commit 1 year ago
CHANGELOG.md 4547782a4a first commit 1 year ago
CatalogueMetadataAwareInterface.php 4547782a4a first commit 1 year ago
DataCollectorTranslator.php 4547782a4a first commit 1 year ago
IdentityTranslator.php 4547782a4a first commit 1 year ago
LICENSE 4547782a4a first commit 1 year ago
LocaleSwitcher.php 4547782a4a first commit 1 year ago
LoggingTranslator.php 4547782a4a first commit 1 year ago
MessageCatalogue.php 4547782a4a first commit 1 year ago
MessageCatalogueInterface.php 4547782a4a first commit 1 year ago
MetadataAwareInterface.php 4547782a4a first commit 1 year ago
PseudoLocalizationTranslator.php 4547782a4a first commit 1 year ago
README.md 4547782a4a first commit 1 year ago
TranslatableMessage.php 4547782a4a first commit 1 year ago
Translator.php 4547782a4a first commit 1 year ago
TranslatorBag.php 4547782a4a first commit 1 year ago
TranslatorBagInterface.php 4547782a4a first commit 1 year ago
composer.json 4547782a4a first commit 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 ! »

Sponsor

The Translation component for Symfony 7.1 is backed by:

  • Crowdin, a cloud-based localization management software helping teams to go global and stay agile.

Help Symfony by sponsoring its development!

Resources