contao-community-alliance / translator

Multipurpose translation manager and interface
GNU Lesser General Public License v3.0
2 stars 2 forks source link

Translator

Build Status

The Contao Community Alliance translation library allows easy use of various translation string sources.

It ships with a collection of various translation string providers:

In addition it also provides a translator chain using which various translators can be stacked.

Usage:

It integrates into the Contao CMS providing a translator service. To use it, just get the service from the dependency container:

<?php

/** @var ContaoCommunityAlliance\Translator\TranslatorInterface */
$translator = $GLOBALS['container']['translator'];

// Get the translation of yes from the MSC domain.
$translated = $translator->translate('yes', 'MSC');

// Sub arrays known in Contao can be accessed usng the dot as separator.
$translated = $translator->translate('title.0', 'tl_content');  

Known limitations: