HighSpeaker/vendor/symfony/translation
2024-01-31 22:15:08 +08:00
..
Catalogue Save 2022-12-24 22:10:40 +08:00
Command Save 2022-12-24 22:10:40 +08:00
DataCollector Save 2022-12-24 22:10:40 +08:00
DependencyInjection Save 2022-12-24 22:10:40 +08:00
Dumper Save 2022-12-24 22:10:40 +08:00
Exception Save 2022-12-24 22:10:40 +08:00
Extractor Save 2022-12-24 22:10:40 +08:00
Formatter Save 2022-12-24 22:10:40 +08:00
Loader Save 2022-12-24 22:10:40 +08:00
Provider Save 2022-12-24 22:10:40 +08:00
Reader Save 2022-12-24 22:10:40 +08:00
Resources Save 2022-12-24 22:10:40 +08:00
Test Save 2022-12-24 22:10:40 +08:00
Util Save 2022-12-24 22:10:40 +08:00
Writer Save 2022-12-24 22:10:40 +08:00
CHANGELOG.md Save 2022-12-24 22:10:40 +08:00
composer.json Save 2022-12-24 22:10:40 +08:00
DataCollectorTranslator.php Save 2022-12-24 22:10:40 +08:00
IdentityTranslator.php Save 2022-12-24 22:10:40 +08:00
LICENSE Framework Update 2024-01-31 22:15:08 +08:00
LoggingTranslator.php Save 2022-12-24 22:10:40 +08:00
MessageCatalogue.php Save 2022-12-24 22:10:40 +08:00
MessageCatalogueInterface.php Save 2022-12-24 22:10:40 +08:00
MetadataAwareInterface.php Save 2022-12-24 22:10:40 +08:00
PseudoLocalizationTranslator.php Save 2022-12-24 22:10:40 +08:00
README.md Save 2022-12-24 22:10:40 +08:00
TranslatableMessage.php Save 2022-12-24 22:10:40 +08:00
Translator.php Save 2022-12-24 22:10:40 +08:00
TranslatorBag.php Save 2022-12-24 22:10:40 +08:00
TranslatorBagInterface.php Save 2022-12-24 22:10:40 +08:00

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