Zory a30513060a frist 1 maand geleden
..
Catalogue a30513060a frist 1 maand geleden
Command a30513060a frist 1 maand geleden
DataCollector a30513060a frist 1 maand geleden
DependencyInjection a30513060a frist 1 maand geleden
Dumper a30513060a frist 1 maand geleden
Exception a30513060a frist 1 maand geleden
Extractor a30513060a frist 1 maand geleden
Formatter a30513060a frist 1 maand geleden
Loader a30513060a frist 1 maand geleden
Provider a30513060a frist 1 maand geleden
Reader a30513060a frist 1 maand geleden
Resources a30513060a frist 1 maand geleden
Test a30513060a frist 1 maand geleden
Util a30513060a frist 1 maand geleden
Writer a30513060a frist 1 maand geleden
CHANGELOG.md a30513060a frist 1 maand geleden
CatalogueMetadataAwareInterface.php a30513060a frist 1 maand geleden
DataCollectorTranslator.php a30513060a frist 1 maand geleden
IdentityTranslator.php a30513060a frist 1 maand geleden
LICENSE a30513060a frist 1 maand geleden
LocaleSwitcher.php a30513060a frist 1 maand geleden
LoggingTranslator.php a30513060a frist 1 maand geleden
MessageCatalogue.php a30513060a frist 1 maand geleden
MessageCatalogueInterface.php a30513060a frist 1 maand geleden
MetadataAwareInterface.php a30513060a frist 1 maand geleden
PseudoLocalizationTranslator.php a30513060a frist 1 maand geleden
README.md a30513060a frist 1 maand geleden
TranslatableMessage.php a30513060a frist 1 maand geleden
Translator.php a30513060a frist 1 maand geleden
TranslatorBag.php a30513060a frist 1 maand geleden
TranslatorBagInterface.php a30513060a frist 1 maand geleden
composer.json a30513060a frist 1 maand geleden

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

Sponsor

The Translation component for Symfony 7.1 is backed by:

  • Crowdin, a cloud-based localization management software helping teams to go global and stay agile.

Help Symfony by sponsoring its development!

Resources