v/GTT
1
0
mirror of https://github.com/eeeXun/GTT.git synced 2025-05-17 08:10:22 -07:00

48 Commits

Author SHA1 Message Date
eeeXun
16cee7c895 refactor: use http.MethodPost 2023-05-19 19:15:08 +08:00
eeeXun
05f70b1a17 style: reorder DeepL language with alphabet 2023-05-16 14:14:42 +08:00
eeeXun
242523cdd7 refactor: clean up 2023-05-16 13:44:01 +08:00
Oguzhan Selcuk
129d8baed3
feat(translator): Add DeepL support (#20) 2023-05-16 13:26:31 +08:00
eeeXun
6c8bbac7d8 refactor(translation): use type assertion if Sprintf is not needed 2023-05-12 14:04:46 +08:00
Xun
aa957d195c
feat(translator): add ChatGPT (#18)
* feat(translator): add ChatGPT

* feat: check chatgpt error

* refactor: change chatgpt apiKey not set text

* refactor: change language to google

* docs: yaml indent with 4

* refactor: APIKey in struct
2023-05-12 13:53:23 +08:00
eeeXun
837196dbd4 fix: check return code of Google TTS 2023-05-07 16:51:50 +08:00
eeeXun
24cadc4072 refactor: check Apertium translate with responseData instead of StatusCode 2023-04-29 21:18:09 +08:00
eeeXun
ecdebc39ad refactor: remove unneeded type conversion 2023-04-29 17:24:21 +08:00
eeeXun
04263a4eaf refactor: rename bing lang.go to language.go 2023-04-29 13:51:00 +08:00
eeeXun
29643a3cda feat: update google language 2023-04-29 13:46:43 +08:00
eeeXun
d0072abecc refactor: new a core.Language instead of return by function
Nothing needs to be initialized in core.Language. Just new one.
2023-04-29 01:41:31 +08:00
eeeXun
4f30ce9df6 refactor: rename Translator name without Translate 2023-04-29 00:17:09 +08:00
eeeXun
7788d82c4f refactor: new setUpData in BingTranslate 2023-04-23 21:16:01 +08:00
eeeXun
96e7b6c3ac refactor: return translation in struct 2023-04-22 21:02:38 +08:00
eeeXun
9feba79000 style: reorder AllTranslator 2023-04-22 20:37:43 +08:00
eeeXun
1e572de3df style(format): run gofmt 2023-04-21 16:17:32 +00:00
Xun
e0c5569adf
feat(translator): add BingTranslate (#16) 2023-04-22 00:17:18 +08:00
eeeXun
8ddd42b431 refactor: using in TTSLock in bool instead of int8
There should only one thread in TTSLock. bool is enough.
2023-04-07 20:27:51 +08:00
eeeXun
42b01a8cb2 refactor: rename variables & change some data type to interface array 2023-03-30 19:49:05 +08:00
eeeXun
39c892156c refactor: remove unneeded addition assignment operator
ApertiumTranslate and ArgosTranslate don't need it for translation. Just
use assignment operator.
2023-03-27 16:41:57 +08:00
eeeXun
62987e6c5e fix: ReversoTranslate with multi-line translation 2023-03-27 16:39:01 +08:00
eeeXun
b190b66132 fix: ReversoTranslate doesn't support translation of same language 2023-03-15 16:18:10 +08:00
eeeXun
cbd985b599 refactor: make Language, TTSLock and EngineName to struct in Translator
GetSrcLang, GetDstLang, SetSrcLang, SetDstLang, SwapLang are reusable
functions from translator to translator. So make Language struct.

GetEngineName is also a reusable function. So make EngineName struct.

Finally, let Translator to inherit those functions in these three
(Language, TTSLock, EngineName) structs. No need to write the duplicated
functions for each Translator.
2023-03-10 23:37:08 +08:00
eeeXun
13e9f96c2b refactor: defer SoundLock.Release function in PlayTTS
SoundLock should release before leaving the PlayTTS function
2023-03-10 21:02:06 +08:00
Xun
ea1e23172c
feat(translator): add ReversoTranslate (#14) 2023-03-10 20:51:38 +08:00
eeeXun
c1ebe7eb3c style: move main code out of if statement 2023-02-15 20:39:53 +08:00
eeeXun
df42efc81d refactor: declare data as map[string]interface instead of interface
data in Translate function of ApertiumTranslate and ArgosTranslate is a
map[string]interface, so no need to declare it as interface then convert
it to map[string]interface
2023-02-13 21:09:48 +08:00
Xun
5fcb72cbb2
feat(translator): add ApertiumTranslate (#13) 2023-02-13 15:22:04 +08:00
eeeXun
0239561276 style: Declare string only once in Translate & PlayTTS 2023-02-12 17:22:04 +08:00
eeeXun
34805264b3 refactor: rename go module 2023-02-11 14:23:07 +08:00
eeeXun
8a141e641e refactor(argostranslate): use PostForm instead of Post
The newline of message in url.Values in PostForm doesn't need to be
replaced by `\n`
2023-02-04 13:31:56 +08:00
eeeXun
513ad36470 refactor: NewTranslator in for-loop
NewTranslator by name, so no need to create functions for each Translate
2023-02-03 13:30:55 +08:00
muvment
4c0faab899
feat: Added auto translate for Argos translate (#11)
Seems like Argos also supports auto translate as an experimental feature.
2023-02-01 13:53:49 +08:00
eeeXun
f6b7d6a330 style(format): run goimports 2023-02-01 05:52:22 +00:00
muvment
3f8aa5bcdd
feat: Added Google translate auto option (#9) 2023-02-01 13:52:00 +08:00
eeeXun
6b930d27f8 fix: newline of message in argostranslate need to be replaced with \n 2023-01-31 22:30:33 +08:00
eeeXun
898ac53b97 style: rename NewLibreTranslate to NewArgosTranslate 2023-01-29 15:17:41 +08:00
eeeXun
fe25bd4e2b style: use EngineName for error message 2023-01-29 11:03:39 +08:00
eeeXun
3c33708f33 style: rename LibreTranslate to ArgosTranslate
LibreTranslate is an API and web-app built on top of Argos Translate
2023-01-27 16:49:33 +08:00
eeeXun
1115d19b7a feat: add translatorDropDown 2023-01-27 12:24:42 +08:00
eeeXun
0faaa757e3 feat: add libretranslate 2023-01-26 23:45:59 +08:00
eeeXun
4a15946142 style: rename google to googletranslate 2023-01-26 11:56:38 +08:00
eeeXun
ed2bd312a3 refactor: make translator to an interface 2023-01-26 01:15:53 +08:00
Xun
d99585b386
feat: add definition & part of speech (#5) 2023-01-18 14:30:44 +08:00
eeeXun
10c6877230 style: rename function & reorder function call
- rename function `translatePageHandler` to `translateWindow`
- reorder function call in `ui.go`, let function call jointed
- change the position of comment
2023-01-11 10:49:12 +08:00
eeeXun
94ec8498ac style(format): run goimports 2023-01-09 19:17:01 +00:00
eeeXun
98d1cb3392 Initial commit 2022-10-24 23:43:20 +08:00