Automated page translation with Google

Unknown W. Brackets unknown at simplemachines.org
Fri Mar 23 00:28:37 PDT 2007


An option, although a bit of work, would be to load the code snippets in 
a separate request using JavaScript.  Unfortunately, this would require 
JavaScript (although alternative links could be provided to the same 
content.)  It's definitely nicer than using iframes, but not good enough...

If you're using JavaScript code to make the translation happen, this 
might be reasonable.  All it would have to do is reload the original 
(untranslated) HTML and replace the sections of code with the originals. 
  That wouldn't be too much work, actually.

It's also possible to provide the translation through the server side, 
using a proxy and caching thus allowing you to control it to your 
desires... but this would probably be overdoing it.

That said, in my previous projects I've been very impressed with 
community-driven translation efforts.  I mean, we had something like 35 
volunteer translations of about 250k of text.  That's nothing compared 
to the probably 1500k of text to be translated for D...

Even so, automatic translation just cannot compare to the real thing. 
Not without smarter routines than we have now.

-[Unknown]


> Pragma wrote:
>> 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">
> 
> Oh well - of course it's quite useless to provide a translation button 
> and then mark the whole page as notranslate!
> 
> 
>> But there's nothing like <div google="notranslate">...</div> or 
>> somesuch available that I could find.
> 
> Sigh. I couldn't find one, either, I was hoping I just overlooked the 
> obvious.
> 
>> 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 
> 
> 
> That does work reasonably well. Thanks!



More information about the Digitalmars-d mailing list