gettext / json
gettext 的 Json 格式
v1.0.1
2021-01-22 17:59 UTC
Requires
- php: ^7.2|^8.0
- gettext/gettext: ^5.0.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.15
- oscarotero/php-cs-fixer-config: ^1.0
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.0
This package is auto-updated.
Last update: 2024-08-23 02:04:11 UTC
README
由 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)。请参阅 许可证 获取更多信息。