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

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