lizhen_gitee 5b0b0cc080 vendor il y a 1 an
..
Catalogue 5b0b0cc080 vendor il y a 1 an
Command 5b0b0cc080 vendor il y a 1 an
DataCollector 5b0b0cc080 vendor il y a 1 an
DependencyInjection 5b0b0cc080 vendor il y a 1 an
Dumper 5b0b0cc080 vendor il y a 1 an
Exception 5b0b0cc080 vendor il y a 1 an
Extractor 5b0b0cc080 vendor il y a 1 an
Formatter 5b0b0cc080 vendor il y a 1 an
Loader 5b0b0cc080 vendor il y a 1 an
Provider 5b0b0cc080 vendor il y a 1 an
Reader 5b0b0cc080 vendor il y a 1 an
Resources 5b0b0cc080 vendor il y a 1 an
Test 5b0b0cc080 vendor il y a 1 an
Util 5b0b0cc080 vendor il y a 1 an
Writer 5b0b0cc080 vendor il y a 1 an
CHANGELOG.md 5b0b0cc080 vendor il y a 1 an
DataCollectorTranslator.php 5b0b0cc080 vendor il y a 1 an
IdentityTranslator.php 5b0b0cc080 vendor il y a 1 an
LICENSE 5b0b0cc080 vendor il y a 1 an
LoggingTranslator.php 5b0b0cc080 vendor il y a 1 an
MessageCatalogue.php 5b0b0cc080 vendor il y a 1 an
MessageCatalogueInterface.php 5b0b0cc080 vendor il y a 1 an
MetadataAwareInterface.php 5b0b0cc080 vendor il y a 1 an
PseudoLocalizationTranslator.php 5b0b0cc080 vendor il y a 1 an
README.md 5b0b0cc080 vendor il y a 1 an
TranslatableMessage.php 5b0b0cc080 vendor il y a 1 an
Translator.php 5b0b0cc080 vendor il y a 1 an
TranslatorBag.php 5b0b0cc080 vendor il y a 1 an
TranslatorBagInterface.php 5b0b0cc080 vendor il y a 1 an
composer.json 5b0b0cc080 vendor il y a 1 an

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 5.4/6.0 is backed by:

  • Crowdin, a cloud-based localization management software helping teams to go global and stay agile.
  • Lokalise, a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster.

Help Symfony by sponsoring its development!

Resources