Wednesday, June 30, 2010

Piercing Monroe Fotos

Automatic translation google code languages \u200b\u200b

machine translation in several languages \u200b\u200bby Google


How to include in your site the ability to translate to / from all languages \u200b\u200blive as we write


In the short time available to crops up with some small post ...


Already I have talked about how useful are all those nice things you find in Google Code Playground ... I used a lot in recent months, and leave you a little example on how to make the translation service directly.


With this service you will be able to translate all (or almost) in all other languages \u200b\u200b... and you can indulge on how to apply these scripts. I
for example, I use it in the admin panel a site where I write the Italian version of the menu and text, and as I write in the languages \u200b\u200bthat Google translates I want. Obviously, we always talk about translations not "human" .. but they are much more refined translations (Google does with the help of volunteers who want to give users + corrected versions of the translations).


other fields of applications could be for instance the chat ... I'm chatting with a person ... I write in English and Italian .. the other person has already seen the translation.


still switch to the script: I did only some minor modifications to run the script while I type the text and insert the automatic translation.


This is the script: first we see a link to the library "JSAPI" from the Google server and then a javascript.


 
\u0026lt;script type="text/javascript" src="http://www.google.com/jsapi">
\u0026lt;/ script> \u0026lt;script type="text/javascript">

google.load ("language", "1");

function initialize () {
var text = document.getElementById ("sezione_it). value;
google.language.detect (text, function (result) {
if (! result.error result.language & &) {
google.language.translate (text, result.language, "en"
function (result) {
var translated = document.getElementById ("translation_en");
if (result.translation) {
translated.innerHTML = '\u0026lt;input type = "text" name = "sezione_en" id = "sezione_en "value =" '+ result.translation +' "/> ';

}});

}});}



\u0026lt;/ script>



Here is working example:



And here you can download the sample: Milanos: direct translation with Google


example I just put the ability to translate from Italian into other languages, 3 ... but you can do just about anything.

0 comments:

Post a Comment