Automated page translation with Google

Pragma ericanderton at yahoo.removeme.com
Thu Mar 22 14:27:37 PDT 2007


Walter Bright wrote:
> I've been looking into adding buttons to the D web pages to do automatic 
> translation to different languages. The trouble is, the google 
> translator also attempts to translate the code blocks, resulting in a mess.
> 
> Is there a css tag, hack, or trick to convince google translator to skip 
> those sections?

I googled around for a bit and even tried to see how google's own source snippets stand up to translation.  Apparently, 
it's a known issue.

The only thing I found was a reference to a <meta> tag attribute that disables translation for the whole page:

http://www.google.com/help/faq_translation.html
(bullet #13)
<meta name="google" value="notranslate">

But there's nothing like <div google="notranslate">...</div> or somesuch available that I could find.

FWIW, I found a rather nice javascript widget here for translation support that uses a drop-down instead of buttons. 
The page itself is a live example of it in action (in the menu on the right):
http://forwarddevelopment.blogspot.com/2006/12/add-translation-tool-to-your-blog.html

-- 
- EricAnderton at yahoo



More information about the Digitalmars-d mailing list