zhangdehua 898e06e04e first commit 1 tahun lalu
..
Catalogue 898e06e04e first commit 1 tahun lalu
Command 898e06e04e first commit 1 tahun lalu
DataCollector 898e06e04e first commit 1 tahun lalu
DependencyInjection 898e06e04e first commit 1 tahun lalu
Dumper 898e06e04e first commit 1 tahun lalu
Exception 898e06e04e first commit 1 tahun lalu
Extractor 898e06e04e first commit 1 tahun lalu
Formatter 898e06e04e first commit 1 tahun lalu
Loader 898e06e04e first commit 1 tahun lalu
Provider 898e06e04e first commit 1 tahun lalu
Reader 898e06e04e first commit 1 tahun lalu
Resources 898e06e04e first commit 1 tahun lalu
Test 898e06e04e first commit 1 tahun lalu
Util 898e06e04e first commit 1 tahun lalu
Writer 898e06e04e first commit 1 tahun lalu
CHANGELOG.md 898e06e04e first commit 1 tahun lalu
CatalogueMetadataAwareInterface.php 898e06e04e first commit 1 tahun lalu
DataCollectorTranslator.php 898e06e04e first commit 1 tahun lalu
IdentityTranslator.php 898e06e04e first commit 1 tahun lalu
LICENSE 898e06e04e first commit 1 tahun lalu
LocaleSwitcher.php 898e06e04e first commit 1 tahun lalu
LoggingTranslator.php 898e06e04e first commit 1 tahun lalu
MessageCatalogue.php 898e06e04e first commit 1 tahun lalu
MessageCatalogueInterface.php 898e06e04e first commit 1 tahun lalu
MetadataAwareInterface.php 898e06e04e first commit 1 tahun lalu
PseudoLocalizationTranslator.php 898e06e04e first commit 1 tahun lalu
README.md 898e06e04e first commit 1 tahun lalu
TranslatableMessage.php 898e06e04e first commit 1 tahun lalu
Translator.php 898e06e04e first commit 1 tahun lalu
TranslatorBag.php 898e06e04e first commit 1 tahun lalu
TranslatorBagInterface.php 898e06e04e first commit 1 tahun lalu
composer.json 898e06e04e first commit 1 tahun lalu

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 6.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