jun 241d78f74c first commit 1 week ago
..
Catalogue 241d78f74c first commit 1 week ago
Command 241d78f74c first commit 1 week ago
DataCollector 241d78f74c first commit 1 week ago
DependencyInjection 241d78f74c first commit 1 week ago
Dumper 241d78f74c first commit 1 week ago
Exception 241d78f74c first commit 1 week ago
Extractor 241d78f74c first commit 1 week ago
Formatter 241d78f74c first commit 1 week ago
Loader 241d78f74c first commit 1 week ago
Provider 241d78f74c first commit 1 week ago
Reader 241d78f74c first commit 1 week ago
Resources 241d78f74c first commit 1 week ago
Test 241d78f74c first commit 1 week ago
Util 241d78f74c first commit 1 week ago
Writer 241d78f74c first commit 1 week ago
CHANGELOG.md 241d78f74c first commit 1 week ago
DataCollectorTranslator.php 241d78f74c first commit 1 week ago
IdentityTranslator.php 241d78f74c first commit 1 week ago
LICENSE 241d78f74c first commit 1 week ago
LoggingTranslator.php 241d78f74c first commit 1 week ago
MessageCatalogue.php 241d78f74c first commit 1 week ago
MessageCatalogueInterface.php 241d78f74c first commit 1 week ago
MetadataAwareInterface.php 241d78f74c first commit 1 week ago
PseudoLocalizationTranslator.php 241d78f74c first commit 1 week ago
README.md 241d78f74c first commit 1 week ago
TranslatableMessage.php 241d78f74c first commit 1 week ago
Translator.php 241d78f74c first commit 1 week ago
TranslatorBag.php 241d78f74c first commit 1 week ago
TranslatorBagInterface.php 241d78f74c first commit 1 week ago
composer.json 241d78f74c first commit 1 week 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 5.4/6.0 is backed by:

  • Crowdin, a cloud-based localization management software helping teams to go global and stay agile.
  • Lokalise, a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster.

Help Symfony by sponsoring its development!

Resources