A Simple Translation Tool For Your Site
File this under cool things you can do when your website is built properly.
Put this module on your sidebar to give your site international flair by letting your users choose to read your site in their own language (courtesy Google Translate). The more real text you’ve got on the site (read: not images), the better this disembabelment works. Now, keep in mind; this is only to help international readers get a gist of what you’re talking about. This does not replace real, human translation. Launching a global enterprise site with this as your localization strategy is like applying for a job at Stanford and putting Jeopardy on your resume.
That being said, it’s a whole lot of fun. Here’s the code:
<form action="http://64.233.179.104/translate_c">
<input type="hidden" name="u" value="http://yoursite.com">
<label for="langpair">Translate this web site into:</label>
<select name=langpair>
<option value="en|de">German</option>
<option value="en|es">Spanish</option>
<option value="en|fr">French</option>
<option value="en|it">Italian</option>
<option value="en|pt">Portuguese</option>
<option value="en|ja">Japanese</option>
<option value="en|ko">Korean</option>
<option value="en|zh-CN">Chinese</option>
</select>
<input type="hidden" name="hl" value="en">
<input type="hidden" name="ie" value="UTF-8">
<input type="hidden" name="oe" value="UTF-8">
<input type="submit" value="Translate!">
</form>
You really don’t have to do much beside replace “http://yoursite.com” with the page you want translated. If you’re especially keen on giving people the option to translate each page on your site, you could have your content management system fill in that field with an entry’s permalink.
Go ahead, try it out. Did I mention it’s a whole lot of fun? It’d probably be even more fun if could read something other than classical Greek and HTML.
Now, before you ask: no. You can’t seem link directly to a page without Google’s top frame. It must check the headers of the referrer, because if you send the form directly to that address, it routes it right back to the Google site with the frame up top. However, if I enter the URL that the form sends me to directly into the address bar, it comes up without a frame. Also, it worked without a frame when I tried it from my RSS reader. I’d be interesting in finding out if anyone was able to accomplish it some other way.
Note: This doesn’t play nice with Flash. It sort of works with sIFR (Flash Replacement technique for headlines). Google must catch the text before sending it to Flash because both the translated and untranslated text show up. Also, it seems to have some issues with certain positioned elements; it seems to have made my logo go away. I suspect it has something to do with the way it places it’s translation hints that get revealed on hover. (Confirmed: it breaks elements with “position: absolute”.) Anyhow, consider yourself warned.
- in the chapter, "Accessibility"
- tagged with google, localization, translation
(Minutia)
- Author:Jesse
- Published:Oct 16, 2007
- Chapters:
- Previous:
- Next:
GetUpdated
ElseWhere
AllChapters
- 2 articles in the chapter Accessibility
- 7 articles in the chapter Announcements
- 1 articles in the chapter App
- 2 articles in the chapter Apple
- 5 articles in the chapter Blogging
- 7 articles in the chapter CMS
- 1 articles in the chapter Code
- 3 articles in the chapter CSS
- 16 articles in the chapter Design
- 2 articles in the chapter DIY
- 4 articles in the chapter Downloads
- 2 articles in the chapter Freebies
- 2 articles in the chapter Gadgets
- 1 articles in the chapter Javascript
- 5 articles in the chapter Journeys
- 1 articles in the chapter Miscellany
- 1 articles in the chapter Mobile
- 59 articles in the chapter Movable Type
- 1 articles in the chapter Photography
- 2 articles in the chapter Plugins
- 1 articles in the chapter Print
- 3 articles in the chapter Projects
- 2 articles in the chapter Reviews
- 2 articles in the chapter SEO
- 10 articles in the chapter Social Networking
- 1 articles in the chapter Standards
- 4 articles in the chapter Writing
ReaderFavorites
- CSS Image Framing
- Tools of the Web Design Trade, Pt.1: Where to Begin
- Social Networking Is Killing My Ability To Write
- 10 Tips For Creating Website Mockups In Photoshop
- MobileMe vs. Dropbox
- Redesign, Part 1: The Logo
- Redesign, Part 2: Stylesheet Philosophy
- The Social Graph in Plain Language
- Writing Your Own Autobiography: The New Persistence of Information

















