From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andrey Tykhonov Newsgroups: gmane.emacs.help Subject: Re: google-translate (was: Re: Is it possible to transform text before feeding it to ispell?) Date: Wed, 9 Sep 2015 10:18:26 +0300 Message-ID: References: <87oahdl3g3.fsf@mbork.pl> <87twr5nrhg.fsf@gmail.com> <87d1xs5yd5.fsf_-_@debian.uxu> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: ger.gmane.org 1441783161 22727 80.91.229.3 (9 Sep 2015 07:19:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 9 Sep 2015 07:19:21 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 09 09:19:17 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZZZeq-0002U5-Tk for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 09:19:05 +0200 Original-Received: from localhost ([::1]:40340 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZZer-0006ed-AI for geh-help-gnu-emacs@m.gmane.org; Wed, 09 Sep 2015 03:19:05 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33180) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZZea-0006ai-5U for help-gnu-emacs@gnu.org; Wed, 09 Sep 2015 03:18:49 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZZeZ-0001uY-6j for help-gnu-emacs@gnu.org; Wed, 09 Sep 2015 03:18:48 -0400 Original-Received: from mail-wi0-x22d.google.com ([2a00:1450:400c:c05::22d]:35892) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZZeY-0001u4-TL for help-gnu-emacs@gnu.org; Wed, 09 Sep 2015 03:18:47 -0400 Original-Received: by wicgb1 with SMTP id gb1so104331944wic.1 for ; Wed, 09 Sep 2015 00:18:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=Kn3zyCxPEcX2U9iJv4OKhMnz5GnmY8fZmW+JnVyHKJM=; b=KdidjuaigY5qekc8y7lgjKaKiNyEC9L1IIopPJbjeSk1/PZ6GLX8oX95j9+2IWXBq3 4WXazty7mUcGV7pmYPb8how+9jb5Chbu06B++bQQ7doCdHm1TVXbYqZYYSmQqE3Xr6fQ wf19FkbcryJUYuLuMe3Od8Nxl6b/nTOv9TvTWBgoyca9/WNzNm/XzVilwv1bZ0eAG2Yc oDOIBOZQoeRmTeNqJ29WiZKFfpjddY07LOdnVE/N7Q8y5Y4YIItb4Wm8nGkjJlJxN4Oh 3lfF2yNO8QJxMy1PR3D0ssTIYY6CGhQdLsh7E2qZa4UjsqM4UhAFbxOf9O0l1ikMcbjO BiRQ== X-Received: by 10.180.81.199 with SMTP id c7mr32887509wiy.87.1441783125667; Wed, 09 Sep 2015 00:18:45 -0700 (PDT) Original-Received: by 10.194.14.198 with HTTP; Wed, 9 Sep 2015 00:18:26 -0700 (PDT) In-Reply-To: <87d1xs5yd5.fsf_-_@debian.uxu> X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:400c:c05::22d X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:107100 Archived-At: Hi Emanuel, On 9 September 2015 at 01:40, Emanuel Berg wrote: > Alexis 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. > Thank you for the bug report! I'll fix it as soon as possible! > > -- > underground experts united > http://user.it.uu.se/~embe8573 > > >