symfony/translation

Provides tools to internationalize your application

Installs: 273 985 051

Dependents: 1 501

Suggesters: 81

Security: 1

Stars: 6 165

Watchers: 12

Forks: 68

v5.3.9 2021-08-26 08:22 UTC

This package is auto-updated.

Last update: 2021-10-28 08:04:22 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