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

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