Translation-Terminator an easy-to-use library which supports DeepL Sogou Baidu translate.

Post your working scripts, libraries and tools for AHK v1.1 and older
tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Translation-Terminator an easy-to-use library which supports DeepL Sogou Baidu translate.

Post by tuzi » 19 Sep 2021, 02:11

Why use DeepL:
DeepL’s networks consistently outperform other translation systems, making ours the world’s best translation machine. Try it out for yourself or read on to see a quantitative comparison of our system to others.

119 paragraphs from different domains were translated by the various systems. External professional translators were hired to review the translations - without information about which system produced which translation. The graph displays how often each system’s translations were rated better than all other translations. Not shown are cases where several systems produced the best translation. The tests were performed in January 2020.
Image




How it works:

Use headless mode of Chrome to visit translation websites (such as https://www.deepl.com/translator) and get results.



Usage:

Very simple.

Code: Select all

DeepLTranslator.init()                        ; Initialize interface
MsgBox,% DeepLTranslator.translate("text")    ; Show translation results.
DeepLTranslator.free()                        ; Release interface resources.
#Include <DeepLTranslator>                    ; Library reference
In addition to Deepl, two other interfaces are currently supported.

Different interfaces are used in the same way.

For example, if you want to translate with Sogou.

Code: Select all

SogouTranslator.init()                        ; Initialize interface
MsgBox,% SogouTranslator.translate("text")    ; Show translation results.
SogouTranslator.free()                        ; Release interface resources.
#Include <SogouTranslator>                    ; Library reference
For more usage, please download the package file, see the source code of the samples, they have detailed comments.

The examples contains a simple translator with GUI, which supports translation between Chinese and English.

Image

Image



Download:

Releases(recommend)

Source Code(need to install Chrome by yourself, not recommend)
Last edited by tuzi on 20 Sep 2021, 11:33, edited 3 times in total.

arcticir
Posts: 694
Joined: 17 Nov 2013, 11:32

Re: Translation-Terminator an easy-to-use library which supports Deepl Sogou Baidu translate.

Post by arcticir » 19 Sep 2021, 06:20

If you're just using Chrome in the background, I think webview2 seems more appropriate.

https://developer.microsoft.com/en-us/microsoft-edge/webview2/

tuzi
Posts: 223
Joined: 27 Apr 2016, 23:40

Re: Translation-Terminator an easy-to-use library which supports Deepl Sogou Baidu translate.

Post by tuzi » 20 Sep 2021, 11:02

arcticir wrote:
19 Sep 2021, 06:20
If you're just using Chrome in the background, I think webview2 seems more appropriate.

https://developer.microsoft.com/en-us/microsoft-edge/webview2/
Thank you.
There are three reasons why I use chrome.
1. AHK have chrome lib.
2. More people use chrome.
3. My system is Win10 ltsc, no edge on it.

Post Reply

Return to “Scripts and Functions (v1)”