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

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