A CLI to convert i18n CSV/TSV files to JSON
Switch branches/tags
Nothing to show
Clone or download
Latest commit f85cbf1 Oct 18, 2017
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
bin fix lint problems Oct 18, 2017
src fix lint problems Oct 18, 2017
tests Fix tsv parsing Oct 17, 2017
.babelrc first commit Sep 13, 2017
.eslintrc.json fix lint problems Oct 18, 2017
.gitignore first commit Sep 13, 2017
.travis.yml add travis Sep 13, 2017
CONTRIBUTING.md first commit Sep 13, 2017
LICENSE first commit Sep 13, 2017
README.md update readme Sep 16, 2017
package-lock.json first commit Sep 13, 2017
package.json fix lint problems Oct 18, 2017

README.md

i18n CSV to JSON CLI

A CLI to convert i18n CSV/TSV files to JSON.

Build Status

Installing

npm install -g i18n-csv2json-cli

Usage

i18n-csv2json-cli --help

Usage: i18n-csv2json-cli [options]

Convert CSV/TSV files to JSON.

Options:

  -V, --version           output the version number
  -f, --from <file-path>  CSV/TSV file path to be converted. (Default: i18n.csv)
  -t, --to <path>         JSON path to be generated. (Default: current path)
  -F, --format            Format JSON file. (Default: false)
  -h, --help              output usage information

Example

Command

i18n-csv2json-cli --from i18n.csv --to locales --format

Input

key,en,de
abc.efg.hij,test_en,test_de
abc.efg.hik,test_en2,test_de2
abc.efa,test en3,test de3

Output

// locales/en.i18n.json
"abc": {
  "efg": {
    "hij": "test_en",
    "hik": "test_en2"
  },
  "efa": "test en3"
}
// locales/de.i18n.json
"abc": {
  "efg": {
    "hij": "test_de",
    "hik": "test_de2"
  },
  "efa": "test de3"
}

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.

License

This project is licensed under the MIT License - see the LICENSE file for details