[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
google-translate (was: Re: Is it possible to transform text before feedi
From: |
Emanuel Berg |
Subject: |
google-translate (was: Re: Is it possible to transform text before feeding it to ispell?) |
Date: |
Wed, 09 Sep 2015 00:40:06 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux) |
Alexis <flexibeast@gmail.com> writes:
> i don't know about ready-made solutions for this,
> but perhaps something could be built around the
> `google-translate` package that's available from
> MELPA and Marmalade?
I have used that from the shell for some time but for
whatever reason it stopped working recently, so thank
you for this. I had to write this -
(require 'w3m-unisearch)
(defun swedish-to-english (&optional text)
(interactive)
(let ((text (get-search-string "ord")))
(google-translate-translate "Swedish" "English" text 'kill-ring)
(let ((translation (string-make-unibyte (current-kill 0 t))))
(message "%s: %s" text translation) )))
(defalias 'sv 'swedish-to-english)
- to get the DWIM region/word-at-point/just-type
interface I also have for w3m Google searches (and
more); for the above to work, get it here:
http://user.it.uu.se/~embe8573/conf/emacs-init/w3m/w3m-unisearch.el
But it seems I found a bug already. Try this line:
(google-translate-translate "Swedish" "English" "i")
It gives an error, even tho such short words are
common in many languages and are likely to be
translated now and then.
--
underground experts united
http://user.it.uu.se/~embe8573
- Is it possible to transform text before feeding it to ispell?, Marcin Borkowski, 2015/09/08
- Re: Is it possible to transform text before feeding it to ispell?, Alexis, 2015/09/08
- Re: Is it possible to transform text before feeding it to ispell?, Tassilo Horn, 2015/09/08
- google-translate (was: Re: Is it possible to transform text before feeding it to ispell?),
Emanuel Berg <=
- Re: google-translate (was: Re: Is it possible to transform text before feeding it to ispell?), Andrey Tykhonov, 2015/09/09
- Re: google-translate (was: Re: Is it possible to transform text before feeding it to ispell?), Emanuel Berg, 2015/09/09
- Re: google-translate, Emanuel Berg, 2015/09/15
- Re: google-translate, Alex Kost, 2015/09/16
- Re: google-translate, Emanuel Berg, 2015/09/16
- Re: google-translate, Emanuel Berg, 2015/09/17
- Re: google-translate, Emanuel Berg, 2015/09/18
- Re: google-translate, Ian Zimmerman, 2015/09/19
- Re: google-translate, Emanuel Berg, 2015/09/19
- Re: google-translate, Emanuel Berg, 2015/09/19