forked from telppa/Translation-Terminator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path2. Simple Example2.ahk
40 lines (29 loc) · 1.35 KB
/
2. Simple Example2.ahk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
; Initialization allows you to specify the chrome.exe path and also speeds up the first translation.
; BaiduTranslator.init() --- Automatically find the path of the installed chrome.exe
; BaiduTranslator.init("x:\xxx\chrome.exe") --- Use specified path of the chrome.exe
BaiduTranslator.init()
; Translate text from Japanese to English.
MsgBox,% BaiduTranslator.translate("今日の天気はとても良いです", "ja", "en")
; Supports automatic detection language by using "auto".
MsgBox,% BaiduTranslator.translate("今日の天気はとても良いです", "auto", "en")
; Omitting the parameters 2 and 3 means translate text from English to Chinese.
MsgBox,% BaiduTranslator.translate("Hello my love")
; It will automatically release resources on exit.
; But you can also release resources manually.
; Please note that after releasing resources, you need to re-initialize it before using again.
BaiduTranslator.free()
ExitApp
#Include <BaiduTranslator>
/*
-------------------------------------------------------------------------
The other libraries are used in a very similar way to BaiduTranslator.
For example:
SogouTranslator.init()
SogouTranslator.translate("text")
SogouTranslator.free()
#Include <SogouTranslator>
DeepLTranslator.init()
DeepLTranslator.translate("text")
DeepLTranslator.free()
#Include <DeepLTranslator>
*/