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