help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: google-translate


From: Emanuel Berg
Subject: Re: google-translate
Date: Sat, 19 Sep 2015 17:03:57 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Ian Zimmerman <itz@buug.org> writes:

>>   (loop for trans-pair in '(("\345" "å") ("\344"
>> "ä") ("\366" "ö") ) do
>
> That looks like an encoding mismatch, not like
> a bug. I bet these byte values are the latin-1 codes
> for these letters.

Now we have left the bug discussion and this is an
issue of my interface. But it may still be of interest
to the writer of google-translate because I didn't
find such an interface to begin with (of course,
otherwise I wouldn't have written mine). What I want,
and now have, is really simple:

    M-x sv RET ord RET

echos

    ord: word

and ditto English to Swedish. For additional languages
a less streamlined interface is OK since I do that
much less.

As for the quoted Elisp, without it, the string
"reader" is translated/displayed "l\344sare" and not
"läsare". And the same for the other chars.

>> (defun translate (src-lang dst-lang text)
>>   (interactive)
>>   (let ((killed kill-ring))
>>     (google-translate-translate src-lang dst-lang text 'kill-ring)
>>     (let ((translation (string-make-unibyte (current-kill 0))))
>                          ^^^^^^^^^^^^^^^^^^^
> Why do you do that? That may be your problem
> right there.

BRB.

-- 
underground experts united
http://user.it.uu.se/~embe8573




reply via email to

[Prev in Thread] Current Thread [Next in Thread]