lorniu / go-translate

Translator on Emacs. Supports multiple engines such as Google, Bing, deepL, ChatGPT, StarDict, Youdao and so on.
GNU General Public License v3.0
274 stars 37 forks source link

Feature request: remember and reuse last translate direction #35

Closed QiangF closed 2 years ago

QiangF commented 2 years ago

When I am reading a paper, the translate direction doesn't change often. If the pair is not at the beginning of gts-translate-list, I have to go down and choose every time.

For example, in my current setting, gts-do-translate will always start with en->zh, if the language is Japanese, I need to press M-n twice. The next invocation of gts-do-translate on another Japanese text will repeat the above procedure. Why not remember the first choice?

 (setq gts-translate-list '(("en" "zh")
                            ("ru" "en")
                            ("ja" "en")
                            ("de" "en")
                            ("fr" "en")))

 (setq gts-default-translator
       (gts-translator
        :picker (gts-noprompt-picker)
        :engines (gts-google-rpc-engine)
        :render (gts-buffer-render)))
QiangF commented 2 years ago

I see there are variables like gts-picker-current-path and gts-picker-last-path, seems like the last path in my above use case is not saved.

QiangF commented 2 years ago

I feel the gts path stuff is too complicated, maybe make auto guess language optional, most user just need a few fixed translation directions.