Closed ShuguangSun closed 1 month ago
If you config as '(zh en)
, it means that translate zh->en
or en->zh
, it will judge whether current text is zh
or en
, then auto choose the proper one.
If there is any issue in your translation, for example, it choose a wrong zh->en
or en->zh
, maybe there is a wrong logic in the code, please report.
I have following configuration and if I understand correctly, gt should pick the right direction of translation. However, it doesn't recognise the word as Dutch (nl) and outputs untranslated word.
(use-package go-translate
:config
(setq gt-default-translator
(gt-translator
:taker (gt-taker :prompt t :langs '(en nl) :text 'word :pick 'paragraph)
:engines (list (gt-bing-engine) (gt-google-engine))
:render (gt-buffer-render)))
)
P.S.: Is it possible to have it prompt for different configs like ts1, ts2, etc from the examples?
I don't know the different between en and nl, and no logic existed to distinguish them.
You can read the doc or code of gt-lang-rules ( M-x describe-variable gt-lang-rules
) for more details, and add the logic for nl if possible.
It's not an easy thing to determine the language, if failed to config the taker to distinguish
en and nl, you can also use C-n
or C-p
to correct the direction in the prompt minibuffer.
Thanks for the explanation! Nice it remembers the translate direction.
I have set the translator from en to zh as default as
(gt-taker :langs '(en zh) :text 'word :pick 'paragraph :prompt t)
. How could I swtich it from zh to en quickly? Do I need to set another translator?