jsonify.php | ||
LICENSE | ||
README.md |
Jsonify 0.1.0
What is it?
Jsonify
is a simple CLI command to turn word lists into JSON documents. It takes all lines in a text file, and turns them into JSON keys,
filling them with a placeholder string. After that, it writes the pretty-print'ed output to disk, so that you can begin translating it.
Requirements
None, other than PHP7 installed in the system. JSONify doesn't use any fancy libraries. Just pure raw PHP.
Use cases
Sometimes, you may have a list of strings that you need to translate, and the translation file needs to be in JSON. You can use this script to easily turn that string list into a JSON document, complete with placeholders so you don't have to place them manually.
For instance, the Laravel framework accepts translation files in JSON - it matches the keys in it with ktranslation calls in Blade templates.
Usage
sudo jsonify [/path/to/filename-to-jsonify.txt]
Installation
To install this, simply copy the script to the directory where binaries usually live:
sudo cp jsonify.php /usr/local/bin/jsonify
sudo chmod +x /usr/local/bin/jsonify
Compatibiliy
It hasn't been tested on Windows and probably won't work there. If you find any bugs, feel free to report them, or squash them yourself.