Closed viglioni closed 1 year ago
Hi!
Thanks for this lib, amazing work.
I have a question, I want to write specific functions to do direct translations, for instance from english to Italian:
(defun translate/en->it () "Translate from english to italian." (interactive) (let ((gts-translate-list '(("en" "it"))) (gts-default-translator (gts-translator :picker (gts-prompt-picker :single t) :engines (list (gts-bing-engine) (gts-google-engine)) :render (gts-buffer-render)))) (gts-translate gts-default-translator))) ;; and now another pair: (defun translate/en->pt () "Translate from english to portuguese." (interactive) (let ((gts-translate-list '(("en" "pt"))) (gts-default-translator (gts-translator :picker (gts-prompt-picker :single t) :engines (list (gts-bing-engine) (gts-google-engine)) :render (gts-buffer-render)))) (gts-translate gts-default-translator)))
It works on the first time, but after that it no matter which function I call it always chooses the first pair called
Is there a way to write those functions?
I tried to write a generic function
(defun translate (from to) "Translate words FROM language TO language." (let ((gts-translate-list (list (list from to))) (gts-default-translator (gts-translator :picker (gts-prompt-picker :single t) :engines (list (gts-bing-engine) (gts-google-engine)) :render (gts-buffer-render)))) (gts-translate gts-default-translator)))
and call (translate "it" "de"), also works only on the first time, after that always repeat the same pair of languages
(translate "it" "de")
Thanks for your attention!
I submitted a new commit. Please try and see if it solves your problem.
it seems to be working! thanks!
Hi!
Thanks for this lib, amazing work.
I have a question, I want to write specific functions to do direct translations, for instance from english to Italian:
It works on the first time, but after that it no matter which function I call it always chooses the first pair called
Is there a way to write those functions?
I tried to write a generic function
and call
(translate "it" "de")
, also works only on the first time, after that always repeat the same pair of languagesThanks for your attention!