manzyuk / google-translate Goto Github PK
View Code? Open in Web Editor NEWObsolete, see https://github.com/atykhonov/google-translate
Obsolete, see https://github.com/atykhonov/google-translate
I've found a typo: googel
instead of google
.
It looks like I can't make an issue in a fork, so I open it here.
https://github.com/manzyuk/google-translate/blob/master/google-translate.el#L284
https://github.com/atykhonov/google-translate/blob/master/google-translate-core-ui.el#L197
Emacs URL already send an UA string "URL/Emacs", faking it using Mozilla
isn't needed (anymore) (emacs 24 ?)
--- google-translate.el.1 2013-11-07 23:08:44.000000000 +0100
+++ google-translate.el 2013-11-07 23:13:00.000000000 +0100
@@ -365,11 +365,7 @@
(let* ((json
(json-read-from-string
(google-translate-insert-nulls
- ;; Google Translate won't let us make a request unless we
- ;; send a "User-Agent" header it recognizes.
- ;; "Mozilla/5.0" seems to work.
- (let ((url-request-extra-headers
- '(("User-Agent" . "Mozilla/5.0"))))
+ (let ()
(google-translate-http-response-body
(google-translate-format-request-url
`(("client" . "t")
Dear manzyuk,
I have tried your google-translate package and I think it is really a great tool to use google translate in emacs.
However, I really want to urge you to add a function that can satisfy my need, which is:
I always translate English and Japanese each other, and the results offered are good, but I always need to know the pronunciation of translated Japanese or the selected Japanese words. It will be great if the results can be shown like 漢字(kanji)
or others forms.
I knew that google translate supports this function which is pretty useful. So I will be very appreciate that if you can add this function. Is it very hard to accomplish this function?
Thanks very much if you can help me.
Best regards!
The "null" google problem can still happen, eg :
http://translate.google.com/translate_a/t?client=t&ie=UTF-8&oe=UTF-8&sl=es&tl=fr&text=Manana
Notice this pattern :
... ,"Manana"]],null,[,"Mañana", ...
The [, isn't handled by google-translate-insert-nulls.
Q&D solution below :
--- google-translate.el.1 2013-11-07 23:08:44.000000000 +0100
+++ google-translate.el 2013-11-07 23:13:00.000000000 +0100
@@ -334,7 +334,7 @@
;; and ",]". `google-translate-insert-nulls' undoes that.
(defun google-translate-insert-nulls (string)
(with-temp-buffer
- (insert string)
+ (insert (replace-regexp-in-string "\\[," "[null," string))
(goto-char (point-min))
(while (re-search-forward "," (point-max) t)
(when (or (looking-at ",")
Hi Oleksandr!
Sorry for disturbing... I've tried to commit google-translate to marmalade repository and I've got: PermissionsError: User "atykhonov" does not own package "google-translate"
. I contacted with marmalade maintainer and he asked me:
Did you contact the author and ask him to add you to the package using marmalade?
Could you please add me to the package using marmalade? Is it possible?
Thank you!
language's order is neutral, but confusing as one can't use iso 3166 codes as "es".
Eg: nor "es" or "espanol" would match "spanish", but "es" would match "estonian".
Someone translating probably knows codes.
workaround : reorder languages.
--- google-translate.el.1 2013-11-07 22:40:14.000000000 +0100
+++ google-translate.el 2013-11-07 22:43:50.000000000 +0100
@@ -149,7 +149,14 @@
(eval-when-compile (require 'cl))
(defvar google-translate-supported-languages-alist
- '(("Afrikaans" . "af")
+ '(("English" . "en")
+ ("Spanish" . "es")
+ ("Espanol" . "es")
+ ("Chinese Simplified" . "zh-CN")
+ ("Chinese Traditional" . "zh-TW")
+ ("German" . "de")
+ ("French" . "fr")
+ ("Afrikaans" . "af")
("Albanian" . "sq")
("Arabic" . "ar")
("Armenian" . "hy")
@@ -158,20 +165,15 @@
("Belarusian" . "be")
("Bengali" . "bn")
("Bulgarian" . "bg")
- ("Chinese Simplified" . "zh-CN")
- ("Chinese Traditional" . "zh-TW")
("Croatian" . "hr")
("Czech" . "cs")
("Danish" . "da")
("Dutch" . "nl")
- ("English" . "en")
("Estonian" . "et")
("Filipino" . "tl")
("Finnish" . "fi")
- ("French" . "fr")
("Galician" . "gl")
("Georgian" . "ka")
- ("German" . "de")
("Greek" . "el")
("Gujarati" . "gu")
("Haitian Creole" . "ht")
(add-to-list 'load-path "~/.emacs.d/APEL")
(add-to-list 'load-path "~/.emacs.d/flim")
(add-to-list 'load-path "~/.emacs.d/w3m")
(require 'w3m-load)
(require 'mime-w3m)
(setq w3m-default-display-inline-images t)
url-do-setup: Symbol's function definition is void: mailcap-parse-mailcaps
the latest flim card there is no 'mailcap-parse-mailcaps'
APEL git://github.com/jeffgran/APEL.git
flim http://git.chise.org/git/elisp/flim.git
w3m git://github.com/emacsmirror/w3m.git
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.