A CLI to convert i18n CSV/TSV files to JSON.
npm install -g i18n-csv2json-cli
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
i18n-csv2json-cli --from i18n.csv --to locales --format
key,en,de
abc.efg.hij,test_en,test_de
abc.efg.hik,test_en2,test_de2
abc.efa,test en3,test de3
// 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"
}
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
This project is licensed under the MIT License - see the LICENSE file for details