2.0.3 • Published 1 year ago

tetiaroa v2.0.3

Weekly downloads
10
License
ISC
Repository
github
Last release
1 year ago

tetiaroa

a useful multi-language automatic generation tool

support

  • google sheet
  • feishu sheet

why tetiaroa?

Quickly generate files in multiple languages, no more copy needed!

install

  npm i tetiaroa@1 -D # commonjs
  npm i tetiaroa@latest -D # esm

Usage

1.options

NameTypeDefaultDescription
batchArray{spreadsheetId:string,range:string}/文档 id 与该文档下的某个区间区域
ouputObject{path:path.resolve(process.cwd(), "./lang"), module: "es6",ext: ".js"}输出文件的路径与格式
langObject{zh: 2,en: 3,ar: 4,}多语言对应的行
completefunction/事件完成的回调
customOutputCallbackfunction/自定义数据转换

2.example

// js file
// if you have not authorized, you must open vpn first !!!

process.env.HTTP_PROXY = "http://127.0.0.1:1087"; // start proxy in node
process.env.HTTPS_PROXY = "http://127.0.0.1:1087";

config in google doc

keyvalueouput
rank.titlehhhrank:{title:"hhh"}
keyonekey:'one','two'
keytwokey:'one','two'
// js file
new tetiaroa({
  batch: [
    {
      spreadsheetId: "18XOx3OVPstZAF4WI0b1QFLr4Wiirn4pKW7ABgPvw27k",
      range: "产品运营!C2:G",
    },
    {
      spreadsheetId: "18XOx3OVPstZAF4WI0b1QFLr4Wiirn4pKW7ABgPvw27k",
      range: "Web多语言!C2:G",
    },
  ],
  lang: {
    zh: 2,
    index: 3,
    ar: 4,
  },
  ouput: {
    path: path.resolve(__dirname, "./lang"),
    module: "common", // support 'json' 'common' 'es6'
    ext: ".json",
  },
  complete: () => {
    // todo
  },
});

FAQ

if you have any problems during use, please solve by yourself

1.2.0

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.2.1

1 year ago

1.1.2

1 year ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago

0.0.9

3 years ago

0.0.8

3 years ago

0.0.7

3 years ago

0.0.5

3 years ago

0.0.6

3 years ago

0.0.3

3 years ago

0.0.4

3 years ago

0.0.2

3 years ago

0.0.1

3 years ago