Skip to content

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

License

Notifications You must be signed in to change notification settings

kanerty/TranslateJson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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文件中(人类的)语言

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%