README.md

September 6, 2022 Β· View on GitHub

logo

build

⚑ Why need this?

i18n messages is stored in Excel file, but it is not easy to edit in your code. So, this tool is created to convert Excel to JSON.

πŸ“œ Features

Excel data structure is converted to JSON. The key of the first column of the first row is required.

keyzh_CNzh_HKenand more languages...
helloδ½ ε₯½δ½ ε₯½hello...
worldδΈ–η•ŒδΈ–η•Œworld!...

output JSON:

{
   "zh_CN": {
        "hello": "δ½ ε₯½",
        "world": "δΈ–η•Œ",
    },
    "zh_HK": {
        "hello": "δ½ ε₯½",
         "world": "δΈ–η•Œ",
    },
    "en": {
        "hello": "hello",
         "world": "world!",
    }
}

🌈 Installation

Using npm:

$ npm install -g excel-to-json-parser

Using yarn:

$ yarn global add excel-to-json-parser

πŸ”₯ Usage

run etj --help without arguments to see list of options:

Usage: etj --sourceFile <dir>

Options:
  -V, --version           output the version number
  -s, --sourceFile <dir>  source file path need to be converted
  -h, --help              display help for command

use CLI

etj --sourceFile /yourdir/example.xlsx
// or
etj -s /yourDir/example.xlsx

πŸ”§ Examples

run example

yarn example

©️ License

MIT