Return to Snippet

Revision: 7172
at July 11, 2008 04:56 by gfazioli


Initial Code
/*
** @name	 : translate()
** @description  : translate
*/
function translate() {
	$$('[rel="translate"]').each(
		function(e) {
			google.language.translate(e.innerHTML, 'it', 'en',
				function(result) {
					if (result.translation) {
						e.innerHTML = result.translation;
					} else {
						alert( 'Translate Error!\n\n' + result.error.message );
					}
				}
			);
		}
	);
}

Initial URL
http://www.undolog.com/2008/05/13/google-ajax-api-language-e-prototypejs/

Initial Description

                                

Initial Title
Google AJAX API Language e Prototype.js

Initial Tags
ajax, javascript, google, api

Initial Language
JavaScript