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

Something wrong with Bing translate #340

Closed
jerry20130912 opened this issue Mar 17, 2020 · 3 comments
Closed

Something wrong with Bing translate #340

jerry20130912 opened this issue Mar 17, 2020 · 3 comments

Comments

@jerry20130912
Copy link

Thanks for this great app!
There is something wrong with Bing translator
[jerry@VM_0_5_centos ~]$ trans -debug -e bing -brief -s en -t zh-CHT -brief "Profile"
16 bytes > HTTP/1.1 200 OK
23 bytes > Cache-Control: private
19 bytes > Content-Length: 18
46 bytes > Content-Type: application/json; charset=utf-8
62 bytes > P3P: CP="NON UNI COM NAV STA LOC CURa DEVa PSAa PSDa OUR IND"
93 bytes > Set-Cookie: SRCHD=AF=NOFORM; domain=.bing.com; expires=Thu, 17-Mar-2022 02:46:47 GMT; path=/
136 bytes > Set-Cookie: SRCHUID=V=2&GUID=21D2E16534BD447496CEB0A0990C0971&dmnchg=1; domain=.bing.com; expires=Thu, 17-Mar-2022 02:46:47 GMT; path=/
98 bytes > Set-Cookie: SRCHUSR=DOB=20200317; domain=.bing.com; expires=Thu, 17-Mar-2022 02:46:47 GMT; path=/
79 bytes > Set-Cookie: _SS=SID=04346362BE8F6E1B1C2B6DF2BFF06F32; domain=.bing.com; path=/
101 bytes > X-MSEdge-Ref: Ref A: F279ACBA1FEC4714909C8AF9DF97BCF8 Ref B: HKGEDGE0506 Ref C: 2020-03-17T02:46:47Z
96 bytes > Set-Cookie: _EDGE_S=F=1&SID=04346362BE8F6E1B1C2B6DF2BFF06F32; path=/; httponly; domain=bing.com
96 bytes > Set-Cookie: _EDGE_V=1; path=/; httponly; expires=Sun, 11-Apr-2021 02:46:47 GMT; domain=bing.com
137 bytes > Set-Cookie: MUID=04925455F59267A424A55AC5F4ED66E3; samesite=none; path=/; secure; expires=Sun, 11-Apr-2021 02:46:47 GMT; domain=bing.com
108 bytes > Set-Cookie: MUIDB=04925455F59267A424A55AC5F4ED66E3; path=/; httponly; expires=Sun, 11-Apr-2021 02:46:47 GMT
36 bytes > Date: Tue, 17 Mar 2020 02:46:46 GMT
18 bytes > Connection: close
1 bytes >
18 bytes > {"statusCode":400}
content = '''
{"statusCode":400}
'''
tokens = ["{", ""statusCode"", ":", "400", "}"]
ast = {
"0,statusCode" "400"
}

[jerry@VM_0_5_centos ~]$ trans -V
Translate Shell 0.9.6.11-git:b0564ad

platform Linux
terminal type xterm-256color
bi-di emulator [N/A]
gawk (GNU Awk) 4.0.2
fribidi (GNU FriBidi) 1.0.2
audio player [NOT INSTALLED]
terminal pager less
web browser xdg-open
user locale zh_CN.UTF-8 (Chinese Simplified)
home language zh-CN
source language auto
target language zh-CN
translation engine google
proxy [NONE]
user-agent Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 Safari/602.1 Epiphany/3.18.2
ip version [DEFAULT]
theme default
init file [NONE]

Report bugs to: https://github.com/soimort/translate-shell/issues

@Shatur
Copy link

Shatur commented Mar 17, 2020

Have the same issue. The problem is in language detection.

@soimort soimort pinned this issue Apr 17, 2020
@Shatur
Copy link

Shatur commented May 10, 2020

I fixed the issue by specifying User Agent in my library: crow-translate/QOnlineTranslator@81d1c81

@soimort soimort unpinned this issue May 11, 2020
@BettyJJ
Copy link

BettyJJ commented Dec 19, 2020

Have the same issue. The problem is in language detection.

Thanks, I added the source language and it worked if I only translate one word without setting other options.

However, then I find that if I add the -b option, it returns a blank result. If I use the -i option, it returns the result in English without translating. These all work well if I use the default engine google. The bing implementation is still broken in some way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants