You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
webshunter 7add8cd235 first commit 1 month ago
..
Catalogue first commit 1 month ago
Command first commit 1 month ago
DataCollector first commit 1 month ago
DependencyInjection first commit 1 month ago
Dumper first commit 1 month ago
Exception first commit 1 month ago
Extractor first commit 1 month ago
Formatter first commit 1 month ago
Loader first commit 1 month ago
Provider first commit 1 month ago
Reader first commit 1 month ago
Resources first commit 1 month ago
Test first commit 1 month ago
Util first commit 1 month ago
Writer first commit 1 month ago
CHANGELOG.md first commit 1 month ago
DataCollectorTranslator.php first commit 1 month ago
IdentityTranslator.php first commit 1 month ago
LICENSE first commit 1 month ago
LoggingTranslator.php first commit 1 month ago
MessageCatalogue.php first commit 1 month ago
MessageCatalogueInterface.php first commit 1 month ago
MetadataAwareInterface.php first commit 1 month ago
PseudoLocalizationTranslator.php first commit 1 month ago
README.md first commit 1 month ago
TranslatableMessage.php first commit 1 month ago
Translator.php first commit 1 month ago
TranslatorBag.php first commit 1 month ago
TranslatorBagInterface.php first commit 1 month ago
composer.json first commit 1 month 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 ! »

Sponsor

The Translation component for Symfony 5.4/6.0 is backed by:

  • Crowdin, a cloud-based localization management software helping teams to go global and stay agile.
  • Lokalise, a continuous localization and translation management platform that integrates into your development workflow so you can ship localized products, faster.

Help Symfony by sponsoring its development!

Resources