root f4b10b55a0 Initial commit 1 月之前
..
Catalogue f4b10b55a0 Initial commit 1 月之前
Command f4b10b55a0 Initial commit 1 月之前
DataCollector f4b10b55a0 Initial commit 1 月之前
DependencyInjection f4b10b55a0 Initial commit 1 月之前
Dumper f4b10b55a0 Initial commit 1 月之前
Exception f4b10b55a0 Initial commit 1 月之前
Extractor f4b10b55a0 Initial commit 1 月之前
Formatter f4b10b55a0 Initial commit 1 月之前
Loader f4b10b55a0 Initial commit 1 月之前
Provider f4b10b55a0 Initial commit 1 月之前
Reader f4b10b55a0 Initial commit 1 月之前
Resources f4b10b55a0 Initial commit 1 月之前
Test f4b10b55a0 Initial commit 1 月之前
Util f4b10b55a0 Initial commit 1 月之前
Writer f4b10b55a0 Initial commit 1 月之前
CHANGELOG.md f4b10b55a0 Initial commit 1 月之前
DataCollectorTranslator.php f4b10b55a0 Initial commit 1 月之前
IdentityTranslator.php f4b10b55a0 Initial commit 1 月之前
LICENSE f4b10b55a0 Initial commit 1 月之前
LoggingTranslator.php f4b10b55a0 Initial commit 1 月之前
MessageCatalogue.php f4b10b55a0 Initial commit 1 月之前
MessageCatalogueInterface.php f4b10b55a0 Initial commit 1 月之前
MetadataAwareInterface.php f4b10b55a0 Initial commit 1 月之前
PseudoLocalizationTranslator.php f4b10b55a0 Initial commit 1 月之前
README.md f4b10b55a0 Initial commit 1 月之前
TranslatableMessage.php f4b10b55a0 Initial commit 1 月之前
Translator.php f4b10b55a0 Initial commit 1 月之前
TranslatorBag.php f4b10b55a0 Initial commit 1 月之前
TranslatorBagInterface.php f4b10b55a0 Initial commit 1 月之前
composer.json f4b10b55a0 Initial commit 1 月之前

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