How to add online dictionaries feature (mainly google translator) for GoldenDict
Right now a discussed solution is in html with an iframe
. Is there a simple translation script/app that read a sting
variable in and return it translated ?
Super User is a question and answer site for computer enthusiasts and power users. It only takes a minute to sign up.
Sign up to join this communityHow to add online dictionaries feature (mainly google translator) for GoldenDict
Right now a discussed solution is in html with an iframe
. Is there a simple translation script/app that read a sting
variable in and return it translated ?
Translate-shell
Translate-shell use different online translation services... we could integrate the whole application or some of it's source to provide translation to goldendict.
https://github.com/soimort/translate-shell
Quick Solution Using Translate-Shell
GoldenDict have a Programs
feature in the dictionary settings section so an easy way to add an online translation feature would be to use one of those two command line tools translate-shell
or the python script doodle-translate
As an example of French/English translation with google under Program section we would just add
trans -e google -s en -t fr -show-original y -show-original-phonetics n -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary n -show-dictionary n -show-alternatives n "%GDWORD%"
and
trans -e google -s fr -t en -show-original y -show-original-phonetics n -show-translation y -no-ansi -show-translation-phonetics n -show-prompt-message n -show-languages y -show-original-dictionary n -show-dictionary n -show-alternatives n "%GDWORD%"
Microsoft Windows Alternative
For windows the same solution could be used but with python + translate or may be cygwin + translate-shell
Here is a capture
"%GDWORD%"
you probably forget the quotes this should work with the whole text @RichieHH