王大坤 577e175234 更新google há 1 ano atrás
..
Catalogue 577e175234 更新google há 1 ano atrás
Command 577e175234 更新google há 1 ano atrás
DataCollector 577e175234 更新google há 1 ano atrás
DependencyInjection 577e175234 更新google há 1 ano atrás
Dumper 577e175234 更新google há 1 ano atrás
Exception 577e175234 更新google há 1 ano atrás
Extractor 577e175234 更新google há 1 ano atrás
Formatter 577e175234 更新google há 1 ano atrás
Loader 577e175234 更新google há 1 ano atrás
Provider 577e175234 更新google há 1 ano atrás
Reader 577e175234 更新google há 1 ano atrás
Resources 577e175234 更新google há 1 ano atrás
Test 577e175234 更新google há 1 ano atrás
Util 577e175234 更新google há 1 ano atrás
Writer 4122133d42 update há 1 ano atrás
CHANGELOG.md 577e175234 更新google há 1 ano atrás
CatalogueMetadataAwareInterface.php 577e175234 更新google há 1 ano atrás
DataCollectorTranslator.php 577e175234 更新google há 1 ano atrás
IdentityTranslator.php 4122133d42 update há 1 ano atrás
LICENSE 577e175234 更新google há 1 ano atrás
LocaleSwitcher.php 577e175234 更新google há 1 ano atrás
LoggingTranslator.php 577e175234 更新google há 1 ano atrás
MessageCatalogue.php 577e175234 更新google há 1 ano atrás
MessageCatalogueInterface.php 577e175234 更新google há 1 ano atrás
MetadataAwareInterface.php 577e175234 更新google há 1 ano atrás
PseudoLocalizationTranslator.php 577e175234 更新google há 1 ano atrás
README.md 577e175234 更新google há 1 ano atrás
TranslatableMessage.php 4122133d42 update há 1 ano atrás
Translator.php 577e175234 更新google há 1 ano atrás
TranslatorBag.php 577e175234 更新google há 1 ano atrás
TranslatorBagInterface.php 4122133d42 update há 1 ano atrás
composer.json 577e175234 更新google há 1 ano atrás

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.2 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