1.1.1 • Published 4 years ago

cj-lang-build v1.1.1

Weekly downloads
4
License
ISC
Repository
github
Last release
4 years ago

Install

  npm i cj-lang-build

Usage

excel 转json

  langBuild = require("cj-lang-build");
  langBuild.xlsToJson({
    input: "sample.xls",  // input xls
    output: "output.json", // output json
    sheet: "sheetname",  // specific sheetname
    rowsToSkip: 5 // number of rows to skip at the top of the sheet; defaults to 0
  }, function(err, result) {
    if(err) {
      console.error(err);
    } else {
      console.log(result);
    }
  });

动态生成语言包

  langBuild = require("cj-lang-build");
  langBuild.langBuild({
    input_temp: "en", // 不传走code码为key  "en"是以英文文案为key 其他值代表对照表的路径
    output: "lang/language/{{ens}}/local.json" // 生成语言包的路径 -必填
  }, function(err, result) {
    if(err) {
      console.error(err);
    } else {
      console.log(result);
    }
  });

生成全局语言包--基于jobs为基础

  langBuild = require("cj-lang-build");
  langBuild.langBuildNew({
    apiUrl:'http://host/world/findByApplicationId', // api地址
    appId: '1305748467817271296' // 项目应用Id
    outPath: 'locales' // 输出词库目录
  }, function(err, result) {
    if(err) {
      console.error(err);
    } else {
      console.log(result);
    }
  });
1.1.1

4 years ago

1.1.0

4 years ago

1.0.7

4 years ago

1.0.6

4 years ago

1.0.5

4 years ago

1.0.4

4 years ago

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago