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

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