1.4.1 • Published 22 days ago

translate-auto v1.4.1

Weekly downloads
-
License
ISC
Repository
-
Last release
22 days ago

translate-auto

安装

npm i -D translate-auto

在根目录可以配置 translate-config.json 文件

{
  appKey: "", // 应用key
  secretKey: "", // 密钥key
  channel: "google", // 翻译渠道,支持google、youdao、baidu,默认google翻译
  //
  targetPath: "src/locales", // 目标地址
  languageList: ["zh-CN", "en"], // 语言列表
  regexp: `\\$t\\(['"]([^'"]+)['"][,\\)]`, // 提取文字正则,默认提取$t()的第一个参数值
  defaultLocale: "zh", // 默认key值语言
  defaultRegexp: `[\\u4E00-\\u9FA5]`, // 提取key值正则,获取翻译文本(例如:判断字符串中是否包含至少一个中文字符)
  //
  filePath: "src", // 需要翻译的目录
  fileSuffix: [".vue", ".js", ".jsx", ".ts", ".tsx"], // 指定翻译的文件后缀
  excludes: ["node_modules", "dist"], // 排除翻译的目录
}

执行翻译

npm run translate
1.4.1

22 days ago

1.3.7

24 days ago

1.4.0

24 days ago

1.3.9

24 days ago

1.3.8

24 days ago

1.3.6

1 month ago

1.3.5

1 month ago

1.3.4

1 month ago

1.3.3

3 months ago

1.3.2

3 months ago

1.3.1

3 months ago

1.3.0

9 months ago

1.2.9

9 months ago

1.2.8

9 months ago

1.2.7

9 months ago

1.2.6

9 months ago

1.2.5

9 months ago

1.2.4

9 months ago

1.2.3

9 months ago

1.2.2

9 months ago

1.2.1

9 months ago

1.2.0

9 months ago

1.1.9

9 months ago

1.1.8

9 months ago

1.1.7

9 months ago

1.1.6

9 months ago

1.1.5

9 months ago

1.1.4

9 months ago

1.1.3

9 months ago

1.1.2

9 months ago

1.1.1

9 months ago

1.1.0

9 months ago

1.0.9

9 months ago

1.0.8

9 months ago

1.0.7

9 months ago

1.0.6

9 months ago

1.0.5

9 months ago

1.0.4

9 months ago

1.0.3

9 months ago

1.0.2

9 months ago

1.0.1

9 months ago

1.0.0

9 months ago