Simple CLI utility to transform word lists into JSON documents
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Miguel N. 415be2e32b Shebang 6 months ago
LICENSE Create JSONify 0.1.0 6 months ago
README.md Create JSONify 0.1.0 6 months ago
jsonify.php Shebang 6 months ago

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.