Setting up Translation Tool API (DeepL X) Using Docker - Freedom in Multilingual Translation

Offering a multilingual translation interface, providing translation services for programs/systems.

Purpose

Providing a multilingual translation interface, rendering translation services for programs/systems.

December 30, 2023, Practical use of Python for testing (to achieve a multilingual solution in Hexo):

After making multiple requests, errors occurred.

1
2
Thread-1 is translating from Chinese to English, length=437                                                        
Response RESULT: {"code":429,"message":"Too Many Requests"}

Overall, the performance is quite disappointing, feeling rather useless.

How to Use

Post to http://192.168.6.116:1188/translate

If using GET, the usage is printed out:

{“code”:200,”message”:”DeepL Free API - Go to /translate with POST.”}

For curl usage:

1
2
3
4
5
6
7
8
curl -X POST http://localhost:1188/translate \
-H "Content-Type: application/json" \
-H "Authorization: Bearer your_access_token" \
-d '{
"text": "Hello, world!",
"source_lang": "EN",
"target_lang": "DE"
}'

Further Reading

Implementation Approach

One-click launch

1
2
3
4
5
6
7
8
9
10
11
version: "3"
services:
deepl:
stdin_open: true
tty: true
ports:
- 1188:1188
image: artem1sobolev/deepl:1.0.1
#same error: no route to. huiwushi/deepl_zu1k
#zu1k/deepl
restart: always

Open firewall port 1188, reverse proxy (if required)

Next Steps

I aim to feed all Chinese language content to this API for translation into English and Traditional Chinese, thus achieving full multilingual functionality; but there’s still a long way to go…

Source of Inspiration

translator - Simple, lightweight, and easy-to-use word translation software

https://github.com/OwO-Network/DeepLX