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