contao-community-alliance/translator
最新稳定版本:2.5.1
Composer 安装命令:
composer require contao-community-alliance/translator
包简介
Multipurpose translation manager and interface
关键字:
README 文档
README
The Contao Community Alliance translation library allows easy use of various translation string sources.
It ships with a collection of various translation string providers:
- Static values that get populated during runtime by code (StaticTranslator).
- Adapter for Contao CMS language string arrays (LangArrayTranslator).
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:
- We have no manual so far. Bummer! :/
- We have not tested it all yet, so please give it a try yourself.
统计信息
- 总下载量: 125.68k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 1
- 依赖项目数: 7
- 推荐数: 0
其他信息
- 授权协议: LGPL-3.0-or-later
- 更新时间: 2014-01-13