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

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