1 Star 14 Fork 7

mtrdong / translator_pyqt5

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

基于PyQT5制作的翻译小程序

通过httpx获取翻译结果,使用PyQT5设计界面,使用SystemHotkey设置全局快捷键

1. 实现基本翻译功能

2. 实现截图(支持快捷键F1启动)或拖入图片进行识别翻译

3. 实现伪划词(复制)翻译,悬浮窗方式输出翻译结果

4. 支持音标发音,翻译结果播报

5. 支持一键复制翻译结果

6. 支持百度翻译、有道词典和搜狗翻译

......

环境搭建

  • 安装Python

推荐安装👉Python 3.8.10

  • 安装依赖包
pip install -r requirements.txt

程序封装

封装exe单文件版(启动慢):

pyinstaller pyinstaller-single.spec

封装exe便携版(启动快):

pyinstaller pyinstaller-portable.spec

程序界面

主界面

翻译引擎

翻译单词

翻译句子

划词翻译(悬浮窗输出)

常见问题

  • 解决Linux运行程序无法输入中文:

复制文件:/usr/lib/x86_64-linux-gnu/qt5/plugins/platforminputcontexts/libfcitxplatforminputcontextplugin.so

到:site-packages/PyQt5/Qt5/plugins/platforminputcontexts

  • 解决Linux运行程序时报错:Could not load the Qt platform plugin "xcb" in "" even though it was found.
sudo apt-get install libxcb-xinerama0
MIT License Copyright (c) 2021 mtrdong Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

基于PyQT5制作的翻译小程序 展开 收起
Python 等 2 种语言
MIT
取消

发行版 (1)

全部

贡献者

全部

近期动态

加载更多
不能加载更多了
Python
1
https://gitee.com/mtrdong/translator_pyqt5.git
git@gitee.com:mtrdong/translator_pyqt5.git
mtrdong
translator_pyqt5
translator_pyqt5
master

搜索帮助