Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jz0ojiang/TranslateJson
Translate (Human) language in json/yaml file | 翻译Json/yaml文件中(人类的)语言
https://github.com/jz0ojiang/TranslateJson
baidu-trans-api json yaml yaml-files
Last synced: 4 months ago
JSON representation
Translate (Human) language in json/yaml file | 翻译Json/yaml文件中(人类的)语言
- Host: GitHub
- URL: https://github.com/jz0ojiang/TranslateJson
- Owner: jz0ojiang
- License: agpl-3.0
- Created: 2020-10-15T08:48:10.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2020-10-19T12:43:49.000Z (over 4 years ago)
- Last Synced: 2024-07-30T21:06:50.819Z (7 months ago)
- Topics: baidu-trans-api, json, yaml, yaml-files
- Language: Python
- Homepage:
- Size: 30.3 KB
- Stars: 4
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# TranslateJson
[Blog Post](#) | [BilibiliVideo(zh)](#) | [中文readme](https://github.com/0ojixueseno0/TranslateJson/blob/master/readme_zh.md)
![](https://img.shields.io/badge/TranslateJson-python-green?style=flat&logo=Python) ![](https://img.shields.io/badge/License-AGPL--3.0_License-yellow?style=flat) ![](https://img.shields.io/badge/Version-0.2.0-blueviolet?style=flat)
## How Can i do?
**Use [Baidu Translation API](http://api.fanyi.baidu.com/doc/11)** Customize translate your value in json file
## Download
Download the version that matches your system in the release
Or you can run:
```bash
$ 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?
```bash
#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```
```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 !!!