gettext / json
Json format for gettext
Installs: 93 287
Dependents: 2
Suggesters: 1
Security: 0
Stars: 5
Watchers: 3
Forks: 1
Open Issues: 0
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-11-23 02:32:03 UTC
README
Created by Oscar Otero http://oscarotero.com oom@oscarotero.com (MIT License)
Json loader and generator to use with gettext/gettext
Installation
composer require gettext/json
Usage example
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');
Please see CHANGELOG for more information about recent changes and CONTRIBUTING for contributing details.
The MIT License (MIT). Please see LICENSE for more information.