Open bamanzi opened 2 weeks ago
You can send word to mainwindow to popup via
goldendict <word>
https://xiaoyifang.github.io/goldendict-ng/topic_commandline/
what the popup window looks like:
(defun goldendict-current-word ()
(interactive)
(let ((sel (if mark-active
(buffer-substring (region-beginning) (region-end))
(buffer-substring
(car (bounds-of-thing-at-point 'word))
(cdr (bounds-of-thing-at-point 'word))))))
(shell-command (concat "nircmd exec show d:\\programs\\goldendict\\goldendict.exe " sel))))
nircmd exec show
is necessary (on Windows) to avoid output buffers (as Emacs on windows would wait for GUI application to quit).
https://github.com/easeflyer/gd_plugin/tree/master/youdao
- youdao_get.py get(url)方式调用有道网页翻译接口,经过测试翻译效果非常不错。唯一问题,段落太大时可能翻译不完全。
- youdao_post.py post 方式调用有道全文翻译接口,比较适合整片文章的翻译。
博客文章: 有道翻译 for GoldenDict Linux 完美屏幕取词插件
UnicodeEncode: 'gbk' codec can't encode character ....
解决办法:添加环境变量 PYTHONIOENCODING=utf-8
即可正常工作。详见: https://github.com/easeflyer/gd_plugin/issues/4
注意:在
youdao_get.py
中 添加os.environ['PYTHONIOENCODING']='utf-8'
并不好使
dict://
协议对接 GoldenDict
GoldenDict
https://github.com/goldendict/goldendict
Dictionary formats supported: https://github.com/goldendict/goldendict/wiki/Supported-Dictionary-Formats
Download (windows only)
Debian/Ubuntu
GoldenDict-NG
(new features: webengine, highdpi, anki_integration, dark theme...)
https://github.com/xiaoyifang/goldendict-ng
Dictionary formats supported: https://xiaoyifang.github.io/goldendict-ng/dictformats/
Download (windows & macos prebuilt)
Debian/Ubuntu