Giter VIP home page Giter VIP logo

google-translate's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

google-translate's Issues

duplicated user-agent

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")

Hi, can you add this function?

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!

JSON readtable error

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 ",")

Issue due to marmalade repository

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 ordering (abbrv ?)

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")

bug report

if open this:

(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) 

use google-translate tip:

url-do-setup: Symbol's function definition is void: mailcap-parse-mailcaps

reason:

the latest flim card there is no 'mailcap-parse-mailcaps'

reference:

APEL git://github.com/jeffgran/APEL.git
flim http://git.chise.org/git/elisp/flim.git
w3m git://github.com/emacsmirror/w3m.git

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.