Improvement requests :  K-Meleon Web Browser Forum
Use this forum to talk about a feature you're missing. 
google translator
Posted by: josejoa
Date: August 16, 2002 07:39AM

It doesn't would be wrong idea to put the translator of google in the right click of mouse like an option more, this is already exist into ie to translate entire sites, as there are many languages apart english thank you.

Options: ReplyQuote
Re: google translator
Posted by: rmn
Date: August 16, 2002 11:44AM

Can anyone confirm if this macro works? I can't test it because I don't have v0.65beta, which I assume this macro will only work on.

translate{
menu="&Translate";
id(id_copy_link_location);
open("http://translate.google.com/translate?langpair=en|es&u=".getclipboard());
}

It is supposed to translate from English into Spanish using Google's translator.

PS: Don't forget to place the menu definitions.

Options: ReplyQuote
Re: google translator
Posted by: josejoa
Date: August 16, 2002 02:07PM

Well rmn, in menu preferences I've put between full screen and bmpmenu() of DocumentPopup:
&Translate = ID_COPY_LINK_LOCATION

and at the end of macros/preferences the same you put above:

translate{
menu="&Translate";
id(id_copy_link_location);
open("http://translate.google.com/translate?langpair=en|es&u=".getclipboard());
}

but only shows "Translate" in the contextual menu and no work at all damn!

Options: ReplyQuote
Re: google translator
Posted by: rmn
Date: August 16, 2002 03:22PM

:-) Sorry.

It should have been in the LinkPopup so that you have to right-click on a link, then click "Translate" to translate the linked page. And you should have added: "macros(translate)" instead of "&Translate = ID_COPY_LINK_LOCATION".

But don't bother, it doesn't work anyway. The getclipboard() function didn't work. Does anyone know how to get the contents of the clipboard?

If you want to put the menu into DocumentPopup, I need someone else to tell me how to read the address bar....

Options: ReplyQuote
Re: google translator
Posted by: rmn
Date: August 16, 2002 04:19PM

Got it! Just ignore my last posting and try out this one.

In macros.cfg:
translate{
menu="&Translate";
open("javascript:top.location=(\"http://translate.google.com/translate?langpair=en|es&u=\"+location.href)");
}

In the DocumentPopup section of menus.cfg:
macros(translate)

Options: ReplyQuote
Re: google translator
Posted by: josejoa
Date: August 16, 2002 06:32PM

I sorry to tell you dont work by anyway thanks, perhaps the next version...

Options: ReplyQuote
Re: google translator
Posted by: po
Date: August 16, 2002 10:08PM

the getclipboard() function will work in the next version, making things like this possible without using javascript. smiling smiley

Options: ReplyQuote
Re: google translator
Posted by: josejoa
Date: August 17, 2002 06:31AM

well with javascript dont work neither, I put it as you say but nothing :-(

Options: ReplyQuote
Re: google translator
Posted by: rmn
Date: August 17, 2002 06:51AM

I have successfully translated the homepages of Google and K-Meleon, but not with this forum page. It might be a problem with the translator itself in reading these (?f=4&i=2464&t=2464[/b])]http://kmeleonbrowser.org/forum/read.php?f=4&i=2464&t=2464) kinds of URL. Try first with K-Meleon's homepage.

Options: ReplyQuote
Re: google translator
Posted by: josejoa
Date: August 17, 2002 10:17PM

Well rmn at the end we got it, I've made some changes because the original code dont worked at all, I've put in macros

translate{
menu="&Translate";
open(javascript:top.location=("http://translate.google.com/translate?langpair=en|es&u="+location.href));
}

and now work pretty well even with this address.

Thank you very much for your help and breath :-))

Options: ReplyQuote
Re: google translator
Posted by: po
Date: August 18, 2002 12:15AM

possibly you are both using different k-meleon versions? the syntax in the macros (particularly regarding use and escaping of double-quotes ["] ) has changed a little since 0.6...

Options: ReplyQuote
Re: google translator
Posted by: josejoa
Date: August 18, 2002 07:45AM

It's possible, I have the 0.6 version built 547.
Well if you like visit my site http://www.josejoa.net (in spanish of course) thanks.

Options: ReplyQuote
Re: google translator
Posted by: rmn
Date: August 18, 2002 10:04AM

> possibly you are both using different k-meleon versions? the syntax in the macros (particularly regarding use and escaping of double-quotes ["] ) has changed a little since 0.6...

> It's possible, I have the 0.6 version built 547.

Aha, so that's the problem. :-)
I DID base the macro on the new beta's "language".

Options: ReplyQuote


K-Meleon forum is powered by Phorum.