wangsaitao b6131e421c 提交 10 months ago
..
Catalogue b6131e421c 提交 10 months ago
Command b6131e421c 提交 10 months ago
DataCollector b6131e421c 提交 10 months ago
DependencyInjection b6131e421c 提交 10 months ago
Dumper b6131e421c 提交 10 months ago
Exception b6131e421c 提交 10 months ago
Extractor b6131e421c 提交 10 months ago
Formatter b6131e421c 提交 10 months ago
Loader b6131e421c 提交 10 months ago
Reader b6131e421c 提交 10 months ago
Resources b6131e421c 提交 10 months ago
Util b6131e421c 提交 10 months ago
Writer b6131e421c 提交 10 months ago
CHANGELOG.md b6131e421c 提交 10 months ago
DataCollectorTranslator.php b6131e421c 提交 10 months ago
IdentityTranslator.php b6131e421c 提交 10 months ago
Interval.php b6131e421c 提交 10 months ago
LICENSE b6131e421c 提交 10 months ago
LoggingTranslator.php b6131e421c 提交 10 months ago
MessageCatalogue.php b6131e421c 提交 10 months ago
MessageCatalogueInterface.php b6131e421c 提交 10 months ago
MessageSelector.php b6131e421c 提交 10 months ago
MetadataAwareInterface.php b6131e421c 提交 10 months ago
PluralizationRules.php b6131e421c 提交 10 months ago
README.md b6131e421c 提交 10 months ago
Translator.php b6131e421c 提交 10 months ago
TranslatorBagInterface.php b6131e421c 提交 10 months ago
TranslatorInterface.php b6131e421c 提交 10 months ago
composer.json b6131e421c 提交 10 months 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