Ever start chatting with a visitor on your site only to realize that you had no idea what they were saying? It happens to us at Hab.la all the time.
Luckily for you, and us Google released a translation API today, which let’s site authors make AJAX calls to translate text in real-time.
I added a plugin to hab.la to do just this. The site operator can specify a language they would like to receive chat’s in, and Hab.la will work with Google Translate to make it’s best judgment about translating the messages.
Google’s funky JavaScript loader makes this plugin a little bit complicated to install, but the extra effort is definitely worth it (if you need your chats translated).
<script type="text/javascript" src="http://www.google.com/jsapi">
<script type="text/javascript">
google.load("language", "1");
</script>
<script type="text/javascript" src="http://static.hab.la/js/wc.js">
<script type="text/javascript">
config = wc_config();
// Choose the google abreviation for your language:
//i.e. en, it, ft, de
config.vars["language"] = "en";
// enable the plugin
config.vars["enableLanguageTranslation"] = 1;
wc_init("1776-526375-10-3058",config );
</script>
The complete list of languages, and more details about the plugin can be found at : http://static.hab.la/examples/translation.html
(It is still very much a work in progress so as always we appreciate your feedback!)
That’s it!
Remember you can already customize all the text fields and colors in hab.la, and even skin it useing custom CSS. Read more on the wiki.
More updates on their way!
Comments [0]