Coder Social home page Coder Social logo

kiwi-cli's Introduction

kiwi cli 加强版

Kiwi 的 CLI 工具 支持Google翻译 支持百度翻译

如何使用

yarn global add @villas/kiwi-clis

推荐与Kiwi-国际化全流程解决方案结合使用

百度翻译开放平台

CLI 参数

v-kiwi --init

初始化项目,生成 kiwi 的配置文件 kiwi-config.json

{
  // kiwi文件根目录,用于放置提取的langs文件
  "kiwiDir": "./.kiwi",

  // 配置文件目录,若调整配置文件,此处可手动修改
  "configFile": "./.kiwi/kiwi-config.json",

  // 语言目录名,注意连线和下划线
  "srcLang": "zh-CN",
  // "en-US", "zh-TW"
  "distLangs": ["en-US"],

  // googleApiKey - 使用百度翻译,此处不配置
  "googleApiKey": "",

  // “v-kiwi --sync” 时自动翻译 (true: 自动)
  "isAutoTranslate": true,

  // 百度APP ID
  "baiduAppid": "",
  // 百度密钥
  "baiduAK": ""

  // import 语句,不同项目请自己配置
  "importI18N": "",

  // 可跳过的文件夹名或者文加名,比如docs、mock等
  "ignoreDir": "",
  "ignoreFile": ""

}

v-kiwi --extract

一键批量替换指定文件夹下的所有文案

v-kiwi --extract [dirPath]

v-kiwi --import

导入翻译文案,将翻译人员翻译的文案,导入到项目中

# 导入送翻后的文案
v-kiwi --import [filePath] en-US

v-kiwi --export

导出未翻译的文案

# 导出指定语言的文案,lang取值为配置中distLangs值,如en-US导出还未翻译成英文的中文文案
v-kiwi --export [filePath] en-US

v-kiwi --sync

同步各种语言的文案,同步未翻译文件

v-kiwi --mock

使用 Google/百度 翻译,翻译未翻译的文案

kiwi-cli's People

Contributors

villasme avatar

Stargazers

caojianxiong avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.