symfony/translation

Provides tools to internationalize your application

Installs: 250 953 900

Dependents: 1 466

Suggesters: 69

Security: 1

Stars: 6 104

Watchers: 13

Forks: 67

v5.3.4 2021-07-25 09:39 UTC

This package is auto-updated.

Last update: 2021-07-27 17:21:33 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