gettext/json

gettext 的 Json 格式

v1.0.1 2021-01-22 17:59 UTC

This package is auto-updated.

Last update: 2024-08-23 02:04:11 UTC


README

Latest Version on Packagist Software License Build Status Quality Score Total Downloads

由 Oscar Otero 创建 http://oscarotero.com oom@oscarotero.com (MIT 许可证)

Json 加载器和生成器,与 gettext/gettext 一起使用

安装

composer require gettext/json

使用示例

use Gettext\Loader\PoLoader;
use Gettext\Loader\JsonLoader;
use Gettext\Generator\JsonGenerator;
use Gettext\Translations;

//Load a .po file and export to .json
$translations = (new PoLoader())->loadFile('locales/translations.po');
(new JsonGenerator())->generateFile($translations, 'locales/translations.json');

//You can load the json file with JsonLoader
$loadedTranslations = (new JsonLoader())->loadFile('locales/translations.json');

请参阅 变更日志 了解最近更改的详细信息,以及 贡献指南 了解贡献细节。

MIT 许可证 (MIT)。请参阅 许可证 获取更多信息。