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

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