如何将 google 翻译等在线词典添加到 GoldenDict?

int*_*ika 5 linux javascript translation

如何为 GoldenDict 添加在线词典功能(主要是谷歌翻译)

现在讨论的解决方案是在 html 中使用iframe. 是否有一个简单的翻译脚本/应用程序可以读取sting变量并将其返回翻译?

int*_*ika 5

翻译外壳

Translate-shell 使用不同的在线翻译服务……我们可以集成整个应用程序或其中的部分源代码来提供对goldendict 的翻译。

https://github.com/soimort/translate-shell

使用 Translate-Shell 的快速解决方案

GoldenDictPrograms在字典设置部分有一个功能,因此添加在线翻译功能的一种简单方法是使用这两个命令行工具之一translate-shell或 python 脚本doodle-translate

作为在程序部分下使用谷歌进行法语/英语翻译的示例,我们只需添加

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%"
Run Code Online (Sandbox Code Playgroud)

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%"
Run Code Online (Sandbox Code Playgroud)

微软视窗替代品

对于 Windows,可以使用相同的解决方案,但使用python + translate或者可能是cygwin + translate-shell

这是一个捕获

在此处输入图片说明

在此处输入图片说明