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

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