Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

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 !!!