Extension:GoogleTranslate

SUGGESTED code for a translation founction calling GoogleTranslate - based upon code from Extension:Link_Suggest

This extension DOES NOT WORK yet.

The current status is that I can now have it translate short texts - and Im working on to split the text into bits.

Problems
Apparntly the Google load works fine, but I cant figure how to access the text.

document.getElementById("wpTextbox1").value; returns nill to me! Can someone plese tell me what I am doing wrong??

Ideas
Please add ideas here:
 * May integrate into this: [FCKEditor]
 * Needs a preview function
 * Needs a 'translate and create new article' function

Tools to use

 * Well this may come in handy: Firebug for FireFox, debugger!
 * And this: PNG converter
 * or this: The Gimp

Code in progress
Please observe: This code does not work right not, it is a prototype! You will need to install Extension Link suggest, to get the button! (will be added as soon as I get a PNG editor :-)

The following is to-do before this will work:
 * Load and link to GoogleTranslate
 * Dropdownlists for the languages
 * See code to build dropdown box contents here - view the source: Googles dynamic translate sample


 * Default languages to be setup in localsettings.php
 * How do I get params like $wgContLang passed to the .js code?????


 * Fetch and replace the edit text (have to figure out how to)

Google AJAX API - dynamic load
See more here: Google API examples

Google translate codesnip
Sample of how to edit directly is found here: [TEX Editor]

JavaScript
New version, does not worl eiter! But its better..