0.1.5 • Published 4 months ago

translation-gen v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

translation-gen NPM MIT

Generate translation json file by Google Sheets

Installation

yarn add translation-gen -D

// or pnpm i translation-gen -D

Usage

  1. Create Service Account and key Link
  2. Add translationgen.yaml on root of your project
  3. Set up translationgen.yaml
  4. Add ENV variable TRANSLATIONGEN_PRIVATE_KEY_PATH into .env file
TRANSLATIONGEN_PRIVATE_KEY_PATH="/path/to/key.json"
  1. Add script in package.json
{
    ...
    "scripts": {
        "transgen": translationgen
    }
}
  1. Run script
$ yarn transgen
  1. Take a look at the output directory in your project. (default: /translation)

translationgen.yaml

KEYDescriptiondefault
targetGoogle sheet file URL-
serviceAccountGoogle Service Account email Link-
sheetTitle of sheet-
sheetIdID of sheet-
outputoutput directory path-
localesArray\<locale>, example: 'ko', 'en'-
localesseparator of key to represent depth"."

Example

target: https://docs.google.com/spreadsheets/d/adfkljjdfslkjlk/edit#gid=0
serviceAccount: google-workspace-manager@your_project.iam.gserviceaccount.com
output: "./translation"
locales: ["ko", "en", "jp"]
sheet: "translation"
sheetId: your_sheet_id
depthSeparator: $
0.1.5

4 months ago

0.1.4

4 months ago

0.1.3

4 months ago

0.1.2

4 months ago

0.1.1

4 months ago

0.1.0

4 months ago