How to translate your web content to different languages?

Have you heard of Altavista's Babel Fish? I found a cool way on how to use their service to translate your website easily.. I just found this out when visiting a website so it's not originally my idea.. just sharing thoughts..

What you will only need is to redirect your website to

HTML:
  1. http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_+language_abbr+&url=+your_site

You can put that in your link directly just like below.

HTML:
  1. <a href="http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_de&amp;url=http://yoursite.com">
  2. </a><a href="http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_en&amp;url=http://yoursite.com">

But I wont recommend that idea since BabelFish change all links to redirect to their site. Try it and you'll see what I mean. Once you switch to German, you can't use the same links again to switch to another language instead you are redirected to its search page which isn't really a good behaviour. The solution is put the link in javascript. Babelfish doesn't encrypt links inside the script tag. Here is what I use:

JavaScript:
  1. function translate(lang){
  2. window.location = "http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_"+lang+"&amp;url=http://www.yoursite.com/";
  3. }
  4. function home(){
  5. window.location = "http://yoursite.com";
  6. }</a>
  7.  
  8. <a href="http://babelfish.altavista.com/babelfish/trurl_pagecontent?lp=en_en&amp;url=http://yoursite.com">&lt;a href='javascript:translate("de");'&gt;  German&lt;/a&gt;
  9. &lt;a href='javascript:home();'&gt;English&lt;/a&gt;

That's more useful. And also do not forget to link back to BabelFish, just a way to thank them.

One catch though, I am not pretty sure if this is illegal. Let me know if it is so I may inform everyone.

Leave a Comment