mailcow/data/web/inc/lib/vendor/symfony/translation
2021-08-08 16:06:55 +02:00
..
Catalogue
Command [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
DataCollector
DependencyInjection [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Dumper [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Exception [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Extractor [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Formatter
Loader [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Provider
Reader
Resources [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
Test
Util
Writer [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
CHANGELOG.md
composer.json [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
DataCollectorTranslator.php
IdentityTranslator.php
LICENSE
LoggingTranslator.php
MessageCatalogue.php [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
MessageCatalogueInterface.php
MetadataAwareInterface.php [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
PseudoLocalizationTranslator.php
README.md
TranslatableMessage.php
Translator.php [Web] Some minor fixes and improvements for PHP 8 2021-08-08 16:06:55 +02:00
TranslatorBag.php
TranslatorBagInterface.php

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

Resources