Skip to content
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

Query error #15

Closed
CirrusG opened this issue Jan 4, 2020 · 18 comments
Closed

Query error #15

CirrusG opened this issue Jan 4, 2020 · 18 comments
Labels
help wanted Extra attention is needed

Comments

@CirrusG
Copy link

CirrusG commented Jan 4, 2020

你好,

image

错误如图显示。
不知道哪里出了问题,是否可以给个解答?
谢谢!

@xinebf
Copy link
Owner

xinebf commented Jan 4, 2020

参考 #1

修改 125 行

    gtrans = GoogleTranslate(result_code='cp1252')

@CirrusG
Copy link
Author

CirrusG commented Jan 4, 2020

按照你说的步骤修改后,可以使用了。不过只能中文翻译为英文,并且翻译后并没有原文对照。

如图所示。

中文翻译为英文
image

英文翻译为中文(未成功)
image

希望可以得解决。
谢谢!

@xinebf
Copy link
Owner

xinebf commented Jan 5, 2020

CP-1252 不支持中文字符

你可以试试把 result_code='cp1252' 改为 result_code='utf-8'

@CirrusG
Copy link
Author

CirrusG commented Jan 5, 2020

修改后结果如下,这会不会跟我的电脑系统是英文的有关呢?

image

@darnn
Copy link

darnn commented Jan 5, 2020

in case it helps, i'm attaching the file i'm using, which i've modified to translate into hebrew, and which doesn't produce those errors:
googletranslate.zip

@xinebf
Copy link
Owner

xinebf commented Jan 6, 2020

这个问题和 Goldendict 有关,在中文的 Windows 系统上面,只能输出使用 gbk 编码的字符,从你截图的报错信息来看是只能输出 cp1252 编码的字符,超出此字符编码范围就会报错,具体怎么解决,现在我也没整明白

@CirrusG
Copy link
Author

CirrusG commented Jan 6, 2020

这个问题和 Goldendict 有关,在中文的 Windows 系统上面,只能输出使用 gbk 编码的字符,从你截图的报错信息来看是只能输出 cp1252 编码的字符,超出此字符编码范围就会报错,具体怎么解决,现在我也没整明白

唔,或许是由于软件版本问题。
这是我下载的Goldendict版本号。
image

@CirrusG
Copy link
Author

CirrusG commented Jan 6, 2020

in case it helps, i'm attaching the file i'm using, which i've modified to translate into hebrew, and which doesn't produce those errors:
googletranslate.zip

Thanks! But the problem still exists.
As shown below
image
The developer considers the problem is related to Goldendict.

@xinebf
Copy link
Owner

xinebf commented Jan 6, 2020

你截图中的版本和我使用的版本是一致的,有上面所说的问题。

@xinebf xinebf added the help wanted Extra attention is needed label Jan 6, 2020
@hufenglin
Copy link

这个是goldendict版本的问题吗?能够快点解决就好啦

@xinebf
Copy link
Owner

xinebf commented Feb 1, 2020

使用这个 commit, 在设置 Goldendict 时将 纯文本 改为 Html, 并在 googletranslate.py修改:

gtrans = GoogleTranslate(result_type='html')

就能正常显示中文了.

@wangran915
Copy link

谢谢分享,使用中有2个问题希望您能帮忙解答下:
1:显示的字太小了,不知道能否调整字体大小及颜色?
2:能否调用音频?
非常期待您的回复,谢谢!

@wangran915
Copy link

请问怎么能只显示单一的翻译结果,把定义和其他频率的翻译给去掉?

@xinebf
Copy link
Owner

xinebf commented Feb 4, 2020

@wangran915
字体大小, Goldendict 工具栏中有缩放按键. 也可以改 CSS 的部分.
音频, 没有加入的计划.
去掉定义, 修改 gtrans = GoogleTranslate(result_type='html', definitions_en=False)

@wangran915
Copy link

wangran915 commented Feb 4, 2020 via email

@wangran915
Copy link

wangran915 commented Feb 4, 2020 via email

@xinebf
Copy link
Owner

xinebf commented Feb 23, 2020

@wangran915
分别移除 124, 128 两行

@xinebf xinebf closed this as completed Feb 23, 2020
@wangran915
Copy link

wangran915 commented Feb 24, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants