symfony/translation

Provides tools to internationalize your application

Installs: 554 072 100

Dependents: 1 827

Suggesters: 90

Security: 1

Stars: 6 577

Watchers: 14

Forks: 89

v7.0.4 2024-02-22 20:27 UTC

This package is auto-updated.

Last update: 2024-04-18 09:30:56 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 ! »

Sponsor

Help Symfony by sponsoring its development!

Resources