google-translate
google-translate copied to clipboard
Failed to search TKK
Any translation attempt is failing with the error: google-translate--search-tkk: Failed to search TKK
Hi @renatofdds,
which version do you use? M-x google-translate-version RET.
I'm also having this problem. Using most recent version 0.11.11
I'm also on 0.11.11
Facing the same issue on 0.11.11. Any help is highly appreciated, BTW, I am behind a http proxy.
Hi all!
I have no idea what exactly could be the root cause of the issue. But with your help I believe the reason could be discovered and the issue fixed.
I've just pushed the code (0.11.12 version) which should help us to debug the issues which relate to retrieving of TKK.
With these changes, please, execute M-: (setq google-translate--tkk-debug t) RET (or M-x eval-expression RET (setq google-translate--tkk-debug t) RET). Then try to translate a word/sentence as usually you do. As the result, two buffers should appear. First one usual one (*Google Translate*) with the translation, and the second one (*Google Translate Debug*) with the debug info, i.e. HTML which is used for retrieving of TKK. Then please paste the contents of *Google Translate Debug* buffer here.
If you'll see that someone already posted the similar output as you get, please feel free to post it again, or just notify that you get the same output. I just believe that additional information would be helpful.
Actually any help is highly appreciated!
Thank you in advance!
Thank you for the efforts and further steps. I will report the test results soon.
After upgrading to 0.11.12 and setting the debug to true as you suggested I did a google-translate-smooth-translate.
I don't see two windows open and I receive the same error. This is what happens
Translate : "The text to be translated appears here correctly (Japanese)" RET Translate from : Japanese RET Translate to : English RET connecting to proxy.xxx.xxx.xx Failed to Search TKK
But version 0.11.10 works perfectly at my home computer (11.11 and 11.12 not tested yet). The above test was from my office computer and the only difference is that, the office computer is behind a http proxy. So I strongly doubt it has something to do with proxy.
Further testing for connection through proxy
- 'wget' from terminal connects successfully to http and https 2.'eww' from emacs connects to http but fails to establish a connection to https
- 'package-list-packages' from emacs downloads successfully from http sources (melpa and org) but fails to download from https source (marmalade)
Since google translate has to establish a connection to https://translate.google.com, i strongly suspect it has something to do with my proxy setting. Sorry if I wasted your time.
But I would sincerely appreciate if you can point out some ways I can make it to work in my work-computer behind proxy. I also hope many people need google translate in their office computer which is normally behind a proxy.
Thank you for your time and efforts
Interesting. My case is opposite. While it works on my office computer, doesn't work on my home computer. Both uses same emacs settings including google-translate's versions(0.11.13).
EDITED:
- works on my ~~home~~ office computer
- doesn't work on my ~~office~~ home computer
SOLVED The issue was Emacs-25.0 was using the "GET method" to connect to HTTPS sites, which my company's firewall (proxy) didn't like. The solution is to make Emacs use the "CONNECT method" to request connection to HTTPS sites (which the proxy allows). The following page correctly directed me towards the solution.
http://emacs.1067599.n8.nabble.com/bug-11788-url-http-does-not-properly-handle-https-over-proxy-td46070.html
Either modify that one particular .el file and rebuild you emacs OR update to 'emacs-snapshot' version-26. I took the easier step and updated to Emacs-26.0.50.2. Now google-translate works like a charm within emacs. Thank you all for the pointers and support
@jack836 Good news. Thank you for sharing. BTW, I've edited my comment since it was wrong. My home network doesn't use a proxy AFAIK, but it seems worthwhile to try that. Again, thanks!
When I updated Emacs 25.1 to Emacs 25.2, I found the issue.
The issue is solved on my PC when google-translate package turns to request through HTTPS but not HTTP by setting google-translate-base-url and google-translate--tkk-url as follows
(when (and (= emacs-major-version 25) (<= emacs-minor-version 2))
(setq google-translate-base-url
"https://translate.google.com/translate_a/single"
google-translate--tkk-url
"https://translate.google.com/"))
I am uncertain about the issue at Emacs 25.1 @jack836 mentions above that the problem is solved at Emacs 26 https://github.com/atykhonov/google-translate/issues/52#issuecomment-265949189
Wish it will be helpful.
Info:
Emacs version "25.2.1" which is built with GnuTLS library
(google-translate-version) says "Google Translate (version): 0.11.14"
google-translate package is installed via MELPA version 20170713.119; not MELPA stable
I met the same problem. After configuring a socks5 proxy for emacs, the problem got addressed. Maybe it's concerning to the ISP, who blocks the network traffic to google services. However, I found something weired. With network proxy set globally in gnome 3, the google services can be visited by firefox browser, but they are not available in eww web browser in emacs. The socks5 proxy settings in gnome 3 seems to be ignored.
example socks5 proxy for emacs:
(setq url-gateway-method 'socks)
(setq socks-server '("Default server" "127.0.0.1" 1080 5))
This just started happening to me after months without a problem. But, it went away after a few minutes. I am not using a proxy.
UPDATE: Now using a different computer that also worked without a problem. It's now failing with the same message. 💻🔨
Same problem here. It has been working for months without a problem, but now i get google-translate--search-tkk: Failed to search TKK all the time. I tried to set google-translate--tkk-debug to true, but no second buffer with debug info appears.
Same problem here. It has been working for months without a problem, but now i get
google-translate--search-tkk: Failed to search TKKall the time. I tried to setgoogle-translate--tkk-debugto true, but no second buffer with debug info appears.
same issue here /'' (;;Emacs version 25.3; google-translate version 0.11.14)
same here
GNU Emacs 26.1
Google Translate (version): 0.11.14
The problem seems to be that the google-translate--tkk-regex definition in google-translate-tk.el,
https://github.com/atykhonov/google-translate/blob/d8b84a8359fcc697114d1298840e9a45b111c974/google-translate-tk.el#L50
does not match the appropriate string in the retrieved HTML document, which in my case was
TKK='427110.1469889687'.
I'm also running Emacs 26.1 and version 0.11.14.
same here, I'm investigating and looking for a solution
does not match the appropriate string in the retrieved HTML document
yes, previously HTML had something like the following:
TKK=eval('((function(){var a\x3d3470396290;var b\x3d183821724;return 426874+\x27.\x27+(a+b)})())');
now we have this representation: TKK='427116.3269864724';.
@atykhonov @rantonse
I found a quick fix. Try it:
(when (and (string-match "0.11.14"
(google-translate-version))
(>= (time-to-seconds)
(time-to-seconds
(encode-time 0 0 0 23 9 2018))))
(defun google-translate--get-b-d1 ()
;; TKK='427110.1469889687'
(list 427110 1469889687)))
You can use TKK='427110.1469889687', TKK='427116.3269864724' or other value.
Same problem here. It has been working for months without a problem, but now i get
google-translate--search-tkk: Failed to search TKKall the time. I tried to setgoogle-translate--tkk-debugto true, but no second buffer with debug info appears.
Emacs 25.1.1; Google Translate (version): 0.11.14
A stubborn error in the Messages buffer:
google-translate--search-tkk: Failed to search TKK
even if I change:
(setq google-translate-base-url
"https://translate.google.com/translate_a/single"
google-translate--tkk-url
"https://translate.google.com/")
Same here.
I had the same problems two days ago. My emacs version is 26.1
@SunDawning your fix work for me. Thanks you
(use-package google-translate
:ensure t
:config
(when (and (string-match "0.11.14"
(google-translate-version))
(>= (time-to-seconds)
(time-to-seconds
(encode-time 0 0 0 23 9 2018))))
(defun google-translate--get-b-d1 ()
;; TKK='427110.1469889687'
(list 427110 1469889687))))
@edurante Thanks for your workaround!
I also use use-package, and the below patch works for me. 😃
-:config
+:init
I'm very sorry! The above patch in https://github.com/atykhonov/google-translate/issues/52#issuecomment-424796072 is my misunderstanding. 🙇
(:config is correct, NOT :init)
Also, I need this workaround using bind-keys* instead of :bind:
(use-package google-translate
:config
;; ...
;; Workaround in https://github.com/atykhonov/google-translate/issues/52#issuecomment-424302439
;; ...
;; BEGIN: Workaround which I need
(bind-keys*
("C-c t" . google-translate-at-point)
("C-c T" . google-translate-at-point-reverse))
;; :bind (("C-c t" . google-translate-at-point)
;; ("C-c T" . google-translate-at-point-reverse))
;; END
)
@SunDawning it works very well! Thanks a lot! I'm preparing a patch based on the workaround.
The v0.11.15 have been released with the fix. Please update. It works well. In a case of any issue please report here (the issue is not going to be closed while we have tkk).
All credit to @SunDawning.
Thank you all!
The latest version works fine (no TKK error any more). I needed to restart emacs after re-installing google-translate.
Looks like the error is up again Search failed: ";TKK='", could someone, please, confirm? All worked just about a week ago.
Version: 0.11.15.