symfony/translation

Provides tools to internationalize your application

Installs: 213 554 701

Dependents: 1 473

Suggesters: 71

Security: 1

Stars: 5 992

Watchers: 13

Forks: 63

v5.2.3 2021-01-27 10:15 UTC

This package is auto-updated.

Last update: 2021-02-25 13:43:52 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