jz0ojiang / TranslateJson

Translate (Human) language in json/yaml file | 翻译Json/yaml文件中(人类的)语言

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

TranslateJson

Blog Post | BilibiliVideo(zh) | 中文readme

How Can i do?

Use Baidu Translation API Customize translate your value in json file

Download

Download the version that matches your system in the release

Or you can run:

$ git clone "https://github.com/0ojixueseno0/TranslateJson.git"
$ cd TranslateJson
$ .\TJson.py "example.json or example.yaml"
#Or compiled as a program to use

How to use?

#Windows
$ Tjson.exe example.json
#or
$ Tjson.exe example.yaml
#linux
$ Tjson example.json
#or
$ Tjson example.yaml

When it completed, you will find a file named output.json or output.y(a)ml with result

Configure File

Config.yml

Config:
#Help of Baidu-Trans API:http://api.fanyi.baidu.com/doc/21
  #Default address is Baidu-Trans general API
  api_url: "http://api.fanyi.baidu.com/api/trans/vip/translate"
  app_id: #Fill in your AppID here
  secret: "" #Fill in your key here
  transfrom: en #from "from" trans to "to"
  transto: zh
  #program will not translate the chars in the list
  DetranslateList:
  - "&"
  - "*"
  - ":"
  - "!"
  #Filter mode:whitelist/blacklist will Match the whitelist and blacklist list below
  listmode: whitelist
  #put the key of json in the list
  Whitelist:
  - Title
  - Thursday
  Blacklist:
  - lore

At last

Click the star button pls !!!

About

Translate (Human) language in json/yaml file | 翻译Json/yaml文件中(人类的)语言

License:GNU Affero General Public License v3.0


Languages

Language:Python 100.0%