|
|
há 1 ano atrás | |
|---|---|---|
| .. | ||
| Catalogue | há 1 ano atrás | |
| Command | há 1 ano atrás | |
| DataCollector | há 1 ano atrás | |
| DependencyInjection | há 1 ano atrás | |
| Dumper | há 1 ano atrás | |
| Exception | há 1 ano atrás | |
| Extractor | há 1 ano atrás | |
| Formatter | há 1 ano atrás | |
| Loader | há 1 ano atrás | |
| Reader | há 1 ano atrás | |
| Resources | há 1 ano atrás | |
| Util | há 1 ano atrás | |
| Writer | há 1 ano atrás | |
| CHANGELOG.md | há 1 ano atrás | |
| DataCollectorTranslator.php | há 1 ano atrás | |
| IdentityTranslator.php | há 1 ano atrás | |
| Interval.php | há 1 ano atrás | |
| LICENSE | há 1 ano atrás | |
| LoggingTranslator.php | há 1 ano atrás | |
| MessageCatalogue.php | há 1 ano atrás | |
| MessageCatalogueInterface.php | há 1 ano atrás | |
| MessageSelector.php | há 1 ano atrás | |
| MetadataAwareInterface.php | há 1 ano atrás | |
| PluralizationRules.php | há 1 ano atrás | |
| README.md | há 1 ano atrás | |
| Translator.php | há 1 ano atrás | |
| TranslatorBagInterface.php | há 1 ano atrás | |
| TranslatorInterface.php | há 1 ano atrás | |
| composer.json | há 1 ano atrás | |
The Translation component provides tools to internationalize your application.
$ 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 ! »