I have released my Multi-Language Translation Script (as seen on http://www.mobi-blog.eu) as Open Source. Please feel free to use or adapt it for your own site(s) - you can visit the project homepage at:
http://code.google.com/p/multi-language-translation/
This script will automatically translate any web page or site that contains text written in more than one language, into a single language requested by the user. This can be particularly useful for sites involving a lot of user-generated content - such as blogs, forums, and other community websites. It harnesses the Google AJAX Language API to perform translation and language detection; has the ability to translate between more than 50 languages; and can be deployed easily on virtually any modern website.
The script contains a number of useful and interesting features; performing translations dynamically on screen after a page loads or a language is changed. Users can view the progress of a current translation; and their choice of language will be remembered whenever they visit any page on the site. The source language (and optionally the source text) of specified regions can also be displayed to the user. Any translation errors or timeouts are handled effectively in the unlikely event they occur...
All feedback would be extremely welcome - including comments, enquiries, suggestions and problem reports. This will help the script to evolve as further development takes place over time.
A Bit of History:
This project emerged as a result of work carried out by OdinLab on the Mobi-Blog website during the early summer of 2009. To improve participation, we decided that students should be allowed to post entries in their own native language. This did however present problems with people who did not speak the same language as us or other users - and we agreed that it would be impractical to manually translate the text into various languages ourselves.
Initially, we used the Google 'Translate My Page' Gadget to embed automatic translation functionality into the site. This did initially work very well when the site content was written primarily in English, but there were significant problems when multi-lingual content was added. Indeed, it got to the point where the gadget could not achieve something as rudimentary as translating English text into English!
I was therefore asked to investigate alternatives; and decided to use the Google AJAX Language API - mainly because it did not suffer from these limitations. I created a fully working prototype within around a week; working out how to overcome various technical challenges, as well as creating a user interface and additional functionality. Once we actually had something online to play with, we suddenly realised that the script could in fact be useful for many other sites - as a lot of websites involve users of different nationalities submitting content. Unfortunately, at the time the script was tailored very specifically towards the Mobi-Blog site.
Therefore, a few months later, I started work on making the script far more flexible, so that it could be used on any website. I also made some substantial improvements to the way it worked. After a week or two this was complete, so I then released it as Open Source... And this project was born!
I hope you like the script, and that it is useful to you!