wangsaitao b6131e421c 提交 10 달 전
..
Catalogue b6131e421c 提交 10 달 전
Command b6131e421c 提交 10 달 전
DataCollector b6131e421c 提交 10 달 전
DependencyInjection b6131e421c 提交 10 달 전
Dumper b6131e421c 提交 10 달 전
Exception b6131e421c 提交 10 달 전
Extractor b6131e421c 提交 10 달 전
Formatter b6131e421c 提交 10 달 전
Loader b6131e421c 提交 10 달 전
Reader b6131e421c 提交 10 달 전
Resources b6131e421c 提交 10 달 전
Util b6131e421c 提交 10 달 전
Writer b6131e421c 提交 10 달 전
CHANGELOG.md b6131e421c 提交 10 달 전
DataCollectorTranslator.php b6131e421c 提交 10 달 전
IdentityTranslator.php b6131e421c 提交 10 달 전
Interval.php b6131e421c 提交 10 달 전
LICENSE b6131e421c 提交 10 달 전
LoggingTranslator.php b6131e421c 提交 10 달 전
MessageCatalogue.php b6131e421c 提交 10 달 전
MessageCatalogueInterface.php b6131e421c 提交 10 달 전
MessageSelector.php b6131e421c 提交 10 달 전
MetadataAwareInterface.php b6131e421c 提交 10 달 전
PluralizationRules.php b6131e421c 提交 10 달 전
README.md b6131e421c 提交 10 달 전
Translator.php b6131e421c 提交 10 달 전
TranslatorBagInterface.php b6131e421c 提交 10 달 전
TranslatorInterface.php b6131e421c 提交 10 달 전
composer.json b6131e421c 提交 10 달 전

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 ! »

Resources