-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
在ubuntu22上,划词后未翻译 #1
Comments
Dear Ericwyn, 我明白该如何使用划词翻译功能了。 为命令EzeTranslate -x,设置系统快捷键; 非常感谢您 |
很高兴!你可能是 EzeTranslate 的第一个其他用户哈哈哈哈 但是我有点看不太懂到底是哪里出错了
EzeTranslate 的划词翻译其实很简单
|
哈哈哈哈哈,祝你使用愉快~ |
哈哈 ,非常感谢您这么快的回复,特别是告诉我它的实现原理。也非常荣幸成为 EzeTranslate 的可见的第一个其他用户~~ 但我遇到了一个新的问题。
但是如果用系统自带的Document viewer打开pdf,划词是可以翻译的。可惜Document viewer无法直接在pdf页面进行直接可观的注释。 我不知道,为什么xclip无法获取到 Master PDF Editor 5 的划词内容。你有什么建议吗? 谢谢您~ |
听起来像是 xclip 无法获取划词导致的 EzeTranslate 使用 |
我试试看,谢谢 |
Dear Ericwyn,
您好,非常感谢您开源该划词翻译工具。我非常感兴趣,您对代码注释格式、空格、换行、驼峰格式等的翻译描述,这非常适用于代码阅读、文献阅读。很遗憾,我没有成功使用它,想要请教如何正确使用。
我在ubuntu22上,通过 sudo dpkg -i eze-translate-v1.5-ubuntu-22.deb安装,并安装了相应的xclip 0.13-2。以下是一些使用记录,以及遇到的问题:
1. 通过ubuntu22的show applications中的EzeTranslate应用图标打开该工具,然后在pdf或网页端选中词汇,(执行或不执行 alt/ctrl + enter 快捷键),(执行或不执行 EzeTranslate -x ),并未触发翻译
2. 在EzeTranslate中,点击“设置”,”日志“,显示无法加载/opt/EzeTranslate/config.yaml ,由于权限不够。我检查发现是-rw-r--r-- 1 root root 480 Apr 17 12:02 /opt/EzeTranslate/config.yaml。我猜想也许是因为我是sudo dpkg -i的方式安装的原因;同时显示“IPC 消息发送失败”
3. 在网页端选中词汇,然后在终端执行EzeTranslate -x ,会打开该工具,并成功触发翻译。但是我重新划词,并未再触发翻译。
终端输出:
[04-17 12:00:57] [D] 程序运行目录:/opt/EzeTranslate/
[04-17 12:00:57] [D] config baiduTransAppId : baiduTransAppId-xxxxxxxxxxxxxxx
[04-17 12:00:57] [D] config baiduTransAppSecret : baiduTransAppSecret-xxxxxxxxxxxxxxx
[04-17 12:00:57] [D] config youdaoTransAppId : youdaoTransAppId-xxxxxxxxxxxxxxx
[04-17 12:00:57] [D] config youdaoTransAppSecret : youdaoTransAppSecret-xxxxxxxxxxxxxxx
[04-17 12:00:57] [D] config googleTranslateUrl : translate.google.com
[04-17 12:00:57] [D] config googleTranslateProxy : google.com
[04-17 12:00:57] [D] config formatSpace : false
[04-17 12:00:57] [D] config formatCarriageReturn : false
[04-17 12:00:57] [D] config formatAnnotation : false
[04-17 12:00:57] [D] config translateSelect : google
[04-17 12:00:57] [D] DialUnix failed.
[04-17 12:00:57] [D] IPC 消息发送失败
[04-17 12:00:57] [D] 开始监听 IPC 消息
Listening on /tmp/trans_utils.socket
[04-17 12:00:57] [D] load resource :/opt/EzeTranslate//res-static/icon/icon.png success !
[04-17 12:00:57] [D] load resource :/opt/EzeTranslate//res-static/fonts/NotoSansSC-Medium.ttf success !
[04-17 12:00:57] [E] 配置文件保存失败
[04-17 12:00:57] [E] open /opt/EzeTranslate/config.yaml: permission denied
[04-17 12:00:57] [D] load resource :/opt/EzeTranslate//res-static/fonts/NotoSansSC-Medium.ttf from buf map
[04-17 12:00:58] [D] 接收到 IPC 消息 : NEW_SELECTION
[shell_2024-04-17_12:00:58] xclip -out
获取的划词: d on the robot to execute SLAM online (in real time) with real sensors data.
[04-17 12:00:58] [I] 为 google 翻译设置 URL:translate.google.com
[04-17 12:00:58] [I] 为 google 翻译设置代理:google.com
[04-17 12:00:58] [D] Google 翻译文字:d on the robot to execute SLAM online (in real time) with real sensors data.
[04-17 12:00:58] [D] 总长度:76汉字长度:0
[04-17 12:00:58] [D] ipc response:PONG
[04-17 12:00:58] [D] 已发送给其他翻译进程 : NEW_SELECTION
翻译结果: d 在机器人上使用真实传感器数据在线(实时)执行 SLAM。
4. 由于之前发现的权限不够,因此在终端执行sudo EzeTranslate -x,然后划词并未触发翻译
[04-17 12:02:20] [D] 程序运行目录:/opt/EzeTranslate/
[04-17 12:02:20] [D] config baiduTransAppId : baiduTransAppId-xxxxxxxxxxxxxxx
[04-17 12:02:20] [D] config baiduTransAppSecret : baiduTransAppSecret-xxxxxxxxxxxxxxx
[04-17 12:02:20] [D] config youdaoTransAppId : youdaoTransAppId-xxxxxxxxxxxxxxx
[04-17 12:02:20] [D] config youdaoTransAppSecret : youdaoTransAppSecret-xxxxxxxxxxxxxxx
[04-17 12:02:20] [D] config googleTranslateUrl : translate.google.com
[04-17 12:02:20] [D] config googleTranslateProxy : google.com
[04-17 12:02:20] [D] config formatSpace : false
[04-17 12:02:20] [D] config formatCarriageReturn : false
[04-17 12:02:20] [D] config formatAnnotation : false
[04-17 12:02:20] [D] config translateSelect : google
[04-17 12:02:20] [D] DialUnix failed.
[04-17 12:02:20] [D] IPC 消息发送失败
[04-17 12:02:20] [D] 开始监听 IPC 消息
2024/04/17 12:02:20 Fyne error: Unable to connect to session D-Bus
2024/04/17 12:02:20 Cause: exec: "dbus-launch": executable file not found in $PATH
2024/04/17 12:02:20 At: /home/ericwyn/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/app/app_xdg.go:40
Listening on /tmp/trans_utils.socket
[04-17 12:02:20] [D] load resource :/opt/EzeTranslate//res-static/icon/icon.png success !
2024/04/17 12:02:20 Fyne error: Unable to connect to session D-Bus
2024/04/17 12:02:20 Cause: exec: "dbus-launch": executable file not found in $PATH
2024/04/17 12:02:20 At: /home/ericwyn/go/pkg/mod/fyne.io/fyne/v2@v2.4.4/app/app_xdg.go:177
[04-17 12:02:20] [D] load resource :/opt/EzeTranslate//res-static/fonts/NotoSansSC-Medium.ttf success !
[04-17 12:02:20] [D] load resource :/opt/EzeTranslate//res-static/fonts/NotoSansSC-Medium.ttf from buf map
[04-17 12:02:20] [D] 接收到 IPC 消息 : NEW_SELECTION
[shell_2024-04-17_12:02:20] xclip -out
获取的划词: EzeTranslate -x
[04-17 12:02:20] [I] 为 google 翻译设置 URL:translate.google.com
[04-17 12:02:20] [I] 为 google 翻译设置代理:google.com
[04-17 12:02:20] [D] Google 翻译文字:EzeTranslate -x
[04-17 12:02:20] [D] 总长度:16汉字长度:0
[04-17 12:02:20] [D] ipc response:PONG
[04-17 12:02:20] [D] 已发送给其他翻译进程 : NEW_SELECTION
翻译结果: EzeTranslate -x
5. 在4中执行了sudo EzeTranslate -x之后,然后在终端输入ctrl+c关闭程序,然后输入EzeTranslate -x打开应用失败,显示该套接字绑定的地址已经被其他进程占用
[04-17 12:03:00] [D] 开始监听 IPC 消息
panic: Cannot listen to unix domain socket: listen unix /tmp/trans_utils.socket: bind: address already in use
goroutine 6 [running]:
github.com/Ericwyn/EzeTranslate/ipc.(*UnixSocket).createServer(0xc000118000)
/home/ericwyn/apps/EzeTranslate/ipc/socket.go:35 +0x294
github.com/Ericwyn/EzeTranslate/ipc.(*UnixSocket).StartServer(...)
/home/ericwyn/apps/EzeTranslate/ipc/socket.go:79
github.com/Ericwyn/EzeTranslate/ipc.StartUnixSocketListener(0xc85c28)
/home/ericwyn/apps/EzeTranslate/ipc/server.go:26 +0xe5
created by github.com/Ericwyn/EzeTranslate/ui.startUnixSocketServer in goroutine 1
/home/ericwyn/apps/EzeTranslate/ui/ui.go:146 +0x34
期待您的回复,非常感谢
The text was updated successfully, but these errors were encountered: