i18n-json-to-xlsx-converter CLI
About
i18n JSON to XLSX Converter is a CLI tool runs in a terminal, and helps you to convert a JSON file to an EXCEL file with dot notation keys column and a column of the values of these keys. Or convert an EXCEL file which has one or more translation columns in it to JSON file(s), in no time.
Installation
Install i18n JSON to XLSX Converter with npm
npm install i18n-json-to-xlsx-converter
Usage/Examples
If you have installed i18n JSON to XLSX Converter you can use it with the command
i18n-json-to-xlsx-converter --convert 'file path of the JSON or XLSX file'
If you haven't installed i18n JSON to XLSX Converter you can use it with the command
npx i18n-json-to-xlsx-converter --convert 'file path of the JSON or XLSX file'
Running Tests
To run tests, run the following command
npm run test
Details
i18n JSON to XLSX Converter created for helping developers for generating an EXCEL file from their JSON file which is used for i18n translations. Also, developers can create one, or many JSON files from an EXCEL file for their project, as well.
Features
- It can convert nested i18n JSON file to an EXCEL file
- It can convert an EXCEL file to a JSON file, or files easily
- It runs in a terminal as a CLI
- User friendly
- Well tested
Reason behind converting a JSON file to an XLSX file
Multilingual applications need translation files in the projects. Hence, developers needs language files in JSON file format(s), and these JSON files need to have translation values for each key. Usually different teams are handling the translation values, and they can't work on the JSON files since they are not specialized on the development field.
Assume that we have a JSON file names as en.json
, and it has a content as
{
"nestedObject": {
"nameOfTheArea": {
"title": "Title",
"subTitle": "Subtitle",
"context": "Context"
}
}
}
Since most of them can work on the EXCEL easily, this tool helps developers to provide an EXCEL file for them to fill in the translations. They can fill the EXCEL file with one, or many translation columns they want to provide, and send it back to the developers.
If they fill out the values in the EXCEL file for only one language column for example EN
, the file needs to be in the format of
Key | EN |
---|
nestedObject.nameOfTheArea.title | Title |
nestedObject.nameOfTheArea.title | Subtitle |
nestedObject.nameOfTheArea.title | Context |
If the provided EXCEL file has only one translation value column, the output JSON file will be only one, and it will have the column title as file name. In this case it'll be en.json
.
If they fill out the values in the EXCEL file for multiple language column for example EN
, NL
, DE
, the file needs to be in the format of
Key | EN | NL | DE |
---|
nestedObject.nameOfTheArea.title | Title | Titel | Titel |
nestedObject.nameOfTheArea.title | Subtitle | Ondertitel | Untertitel |
nestedObject.nameOfTheArea.title | Context | Context | Kontext |
If the provided EXCEL file has multiple translation value columns, the output JSON files will be multiple, and they will have the column titles as file names. In this case they'll be en.json
, nl.json
, de.json
i18n JSON to XLSX Converter is a tool for developers to create JSON file(s) with no effort in the end.
Demo
Author
@ofcyln
For support, email ofcyln@gmail.com
🔗 Links
License
MIT