The evident superiority of Google Translate to Babelfish (Altavista), which is the default K-Meleon engine, has been nagging me for a while; because of this, although I know very little of the macro language, I decide to fiddle with the translate.kmm macro...
I got to it via K-Meleon's "Edit|Configuration|Macros" which basically shows the content of the macro folder; translate.kmm is just one of the plain text files sitting there.
After backing it up, I substitued the following lines from the 'PRIVATE' section:
$_Translate_srvc=_("Babel Fish Translation");
$_Translate_text="http://babelfish.altavista.com/babelfish/tr?lp=<from>_<to>&urltext=";
$_Translate_page="http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=<from>_<to>&url=";
with these:
$_Translate_srvc=_("Google Translate");
$_Translate_text="http://translate.google.com/translate_t?langpair=<from>|<to>=";
$_Translate_page="http://translate.google.com/translate?&langpair=<from>|<to>&u=";
Well, I got the full page translation working; unfortunately, the text selection isn't.
Looking around for help, I found the javascript of the Google buttons that are available in the 'Tools' tab of the Google Translate page. Since I can't make heads or tails of it, here it is, hoping that someone more enlightened can solve this riddle (line breaks added, denoted by §).
javascript:var t=((window.getSelection&&window.getSelection())§
||(document.getSelection&&document.getSelection())||(document.selection§
&&document.selection.createRange&&document.selection.createRange().text));§
var e=(document.charset||document.characterSet);if(t!='')§
{location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=de|en&tbb=1&ie='+e;}§
else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=de|en&tbb=1&ie='+e;};
TIA,
Edited 2 time(s). Last edit at 01/31/2008 01:02AM by foobarly.