azettl/php-nano-translation
Composer 安装命令:
composer require azettl/php-nano-translation
包简介
The php-nano-translation class gives you the correct translation from the requested JSON file.
关键字:
README 文档
README
The php-nano-translation class gives you the correct translation from the requested JSON file.
Installation
composer require azettl/php-nano-translation
Usage
require __DIR__ . '/vendor/autoload.php'; $oTranslation = new com\azettl\nano\translation(); $oTranslation->setBasePath('vendor/azettl/php-nano-translation/tests/translations/'); $oTranslation->setFileNamePattern('test.%s.json'); echo $oTranslation->translate('MY_KEY_WITH_VARS', 'en', ['variable' => 'test']);
Translation Key Value: "My {variable} Value" Returns: "My test Value"
统计信息
- 总下载量: 9
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-02