symfony/translation

Provides tools to internationalize your application

Installs: 229 451 074

Dependents: 1 413

Suggesters: 66

Security: 1

Stars: 6 053

Watchers: 13

Forks: 65

v5.3.0-BETA3 2021-05-09 15:52 UTC

This package is auto-updated.

Last update: 2021-05-09 16:28:59 UTC


README

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