Musa 4547782a4a first commit 1 rok pred
..
Catalogue 4547782a4a first commit 1 rok pred
Command 4547782a4a first commit 1 rok pred
DataCollector 4547782a4a first commit 1 rok pred
DependencyInjection 4547782a4a first commit 1 rok pred
Dumper 4547782a4a first commit 1 rok pred
Exception 4547782a4a first commit 1 rok pred
Extractor 4547782a4a first commit 1 rok pred
Formatter 4547782a4a first commit 1 rok pred
Loader 4547782a4a first commit 1 rok pred
Provider 4547782a4a first commit 1 rok pred
Reader 4547782a4a first commit 1 rok pred
Resources 4547782a4a first commit 1 rok pred
Test 4547782a4a first commit 1 rok pred
Util 4547782a4a first commit 1 rok pred
Writer 4547782a4a first commit 1 rok pred
CHANGELOG.md 4547782a4a first commit 1 rok pred
CatalogueMetadataAwareInterface.php 4547782a4a first commit 1 rok pred
DataCollectorTranslator.php 4547782a4a first commit 1 rok pred
IdentityTranslator.php 4547782a4a first commit 1 rok pred
LICENSE 4547782a4a first commit 1 rok pred
LocaleSwitcher.php 4547782a4a first commit 1 rok pred
LoggingTranslator.php 4547782a4a first commit 1 rok pred
MessageCatalogue.php 4547782a4a first commit 1 rok pred
MessageCatalogueInterface.php 4547782a4a first commit 1 rok pred
MetadataAwareInterface.php 4547782a4a first commit 1 rok pred
PseudoLocalizationTranslator.php 4547782a4a first commit 1 rok pred
README.md 4547782a4a first commit 1 rok pred
TranslatableMessage.php 4547782a4a first commit 1 rok pred
Translator.php 4547782a4a first commit 1 rok pred
TranslatorBag.php 4547782a4a first commit 1 rok pred
TranslatorBagInterface.php 4547782a4a first commit 1 rok pred
composer.json 4547782a4a first commit 1 rok pred

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