
How can I make my site available in multiple languages?I know that it's not optimal, but I want to make the product information pages on my online store available in a bunch of different languages without paying the major bucks to get a professional translator to maintain them. I know that services like Babelfish let you enter a URL and get the contents translated automatically, but is there some way to hook that into a site directly? You're right, and you're right. It is the case that machine translation through services like Altavista's Babelfish are inferior to having a human translate them (for a good discussion of why this is the case, please see my earlier article why human translators are better than machine translation). Nonetheless, if you want something quick and dirty and are willing to accept that the results might be somewhat cockeyed, weird, puzzling or inadvertently amusing, then automated machine translation can be a good option. Rather than Altavista's service, however, I'm more of a fan of Google's Translation Service (I swear, I'm not on Google's payroll, I just like their products and services!). Fortunately for both of us, my friend Brad Feld recently added an automatic-translation feature to his popular blog and his programmer blogged about it, including showing his custom code to achieve the translation. Sweet indeed! Ross (the programmer) shows the following as a self-contained snippet of Javascript + HTML to have a pull-down translation capability: <select name="translate" style="height:18px; font-size:10px;" onchange="javascript:window.location = http://www.google.com/translate_c?hl=en&langpair=en%7C' + this.value + '&u=' + window.location.href;">
<option value="">Translate This Page</option> <option value="ar">Arabic</option> <option value="zh-CN">Chinese Simplified</option> <option value="zh-TW">Chinese Traditional</option> <option value="nl">Dutch</option> <option value="fr">French</option> <option value="de">German</option> <option value="el">Greek</option> <option value="it">Italian</option> <option value="ja">Japanese</option> <option value="ko">Korean</option> <option value="pt">Portuguese</option> <option value="ru">Russian</option> <option value="es">Spanish</option> </select> As you can see, it supports quite a few of the languages Google offers, for better or worse. If you don't want to support them all, just axe a few lines from the code block, so you can, for example, just offer translation into French, Spanish and Italian if you wanted. How's it work? Well, here's an example with the code actually live: Try it, check out this very page in Russian or Greek. Cool, eh? You'll notice that Ross has added some CSS style attributes to the select statement too: if you don't like how he's set things up, you can definitely tweak 'em to get a different result. Hope that helps you add this capability to your site. Let us know how it works out with your overseas and non-English speaking customers.
Help others find this article at Del.icio.us, Digg, Netscape, Reddit, and Stumble Upon
Categorized:
CGI Scripts and Web Site Programming
(Article 7880)
Tagged: babelfish, language translation, machine translation Previous: Did MySpace introduce a new type of friend invitation? Next: How can I add "translate into" country flags to my pages? Subscribe!
Never miss another useful Q&A article again! Subscribe to AskDaveTaylor with Google Reader. This is great, we have a small business in the uk and have many European customers.. It works nicely, how do you automatically remove the google frame? Posted by: daily at February 14, 2008 8:30 AMhow do you automatically remove the google frame? Posted by: VINCE at February 21, 2008 1:46 AMfor some reason i keep getting a error on my website have any ideas how to fix it? check it out www.ocsc.info Posted by: rambow245 at March 16, 2008 7:18 PMHi Dave, It would be really useful if you could figure how to automatically remove the frame. Posted by: Darren at April 8, 2008 2:25 AMHi Guys, I now know how to remove the frame, it dones by a simple break out script. Include the below in the body of the website you are translating: <script language="javascript" type="text/javascript"> It will remove the frame after translation. Posted by: Darren at April 9, 2008 9:44 AMfor some reason i keep getting a error on my website have any ideas how to fix it? check it out www.ocsc.info The reason your does not work is your using a CMS system which uses GET method to retrieve the page information - as google is not the same URL anymore the GET method is not pointing correctly thus it wont work. Posted by: Darren at May 28, 2008 2:56 AMHello, I added the code but it doesn't work. I have no idea why, just nothing happens when I select another language. Can you help? Thanks so much, Val Posted by: val at May 29, 2008 6:22 AMIs there a way to somehow link back to the content in the original language? I could use some help with this. TIA. Posted by: Ron at August 15, 2008 11:56 AMYou could add a "back to main language" link or a home link to your domain, this will send the user back to the original language as by translatibng they actually navigate away from your site. Posted by: Darren at August 19, 2008 2:25 AMDoes any one know how to use a translator in an outlook email so that it converts the email into other languages remaining inside the Outlook?? Posted by: Georgie Imtiaz at September 4, 2008 4:57 AMYour may also be interested in http://www.conveythis.com which offers a free button you can insert into your layout (kind of like addthis.com) which creates a little pop-up/drown-down menu that allows visitors to select their translator and language of preference without having to ever actually leave the page. It's a pretty convenient and simple solution to this situation. Posted by: Steven at October 2, 2008 10:31 AMDoes this work for all browsers? I am unfamiliar with java. Posted by: .oOLimOo. at December 2, 2008 7:00 AMI have a lot to say, but ...
I do have a comment, now that you mention it!
|
![]()
Search
Find just the answers you seek from among our 2300+ free tech support articles by using our Lijit search engine.
Help!
Subscribe to
Ask Dave Taylor!
Free Updates!
Sign up and get free weekly updates and special offers on books, seminars, workshops and more.
Articles and Reviews
Auctions and Online Shopping Blogs and RSS Feeds Building Web site traffic Business and Management Cell Phones and Mobile Phones CGI Scripts and Web Site Programming Computer and Internet Basics d) None of the Above HTML and CSS Industry News and Trade Shows Mac OS X Help MySpace, Facebook, Twitter and Social Network Help Pay Per Click (PPC) Search Engine Optimization Shell Script Programming Sony PSP, MP3 Players, Etc. The Writing Business Unix and Linux Help Video Game Tips and Help Windows Help
Recent Entries
Book Links
|