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

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