Thread overview | ||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
March 22, 2007 Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
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? |
March 22, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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 |
March 22, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Pragma | 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! |
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Fri, 23 Mar 2007 00:27:15 +0200, Walter Bright <newshound@digitalmars.com> wrote: > Pragma wrote: >> 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! You could put each code snippet into its own iframe :) -- Best regards, Vladimir mailto:thecybershadow@gmail.com |
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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!
|
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright |
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?
Seeing as how automated translation is horrible at best, might as well just drop the whole idea ...
|
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Hasan Aljudy | On Fri, 23 Mar 2007 02:08:13 -0600, Hasan Aljudy <hasan.aljudy@gmail.com> 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?
>
>Seeing as how automated translation is horrible at best, might as well just drop the whole idea ...
Agree. Most automated translations are funny and unreadable for native speakers (much funnier than my English writing). IMO, people won't read them at all or have fun and go away. It's definitely preferable to use translations done by native speakers.
BTW, google translator unacceptably distorts the meaning of original Russian text (the translator is in beta, but I don't think it wil get improved much).
|
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Max Samukha |
Max Samukha wrote:
> On Fri, 23 Mar 2007 02:08:13 -0600, Hasan Aljudy
> <hasan.aljudy@gmail.com> 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?
>> Seeing as how automated translation is horrible at best, might as well just drop the whole idea ...
>
> Agree. Most automated translations are funny and unreadable for native
> speakers (much funnier than my English writing). IMO, people won't
> read them at all or have fun and go away. It's definitely preferable
> to use translations done by native speakers.
>
> BTW, google translator unacceptably distorts the meaning of original
> Russian text (the translator is in beta, but I don't think it wil get
> improved much).
European languages might have a chance (since they supposedly are close to English .. some how), I don't know about Russian, and I'm not sure about Japanese either since its grammar is totally unrelated to English .. but it's especially with Arabic that I know it's impossible to get a good auto-translator anytime in the near future.
|
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | 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.
The real trouble is that these translators are not good enough for 'production'.
Here in Italy we laugh at sites automatically translated, we even signal them to friends by e-mail.
One of the funniest was the now non-working it.mp3u.com, where you could find some pearls like:
"100% risk free" => "100% rischia liberamente" that means "you risk 100% freely" (ROTFL), and should be "Libero da rischi al 100%".
Ciao
P.S.: Google Translate brings "rischio di 100% liberamente" that means "risk of 100% freely". LOL
|
March 23, 2007 Re: Automated page translation with Google | ||||
---|---|---|---|---|
| ||||
Posted in reply to Roberto Mariottini | On Fri, 23 Mar 2007 10:21:55 +0100, Roberto Mariottini <rmariottini@mail.com> 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.
>
>The real trouble is that these translators are not good enough for 'production'.
>
>Here in Italy we laugh at sites automatically translated, we even signal
>them to friends by e-mail.
>One of the funniest was the now non-working it.mp3u.com, where you could
>find some pearls like:
>
>"100% risk free" => "100% rischia liberamente" that means "you risk 100% freely" (ROTFL), and should be "Libero da rischi al 100%".
>
>Ciao
>
>P.S.: Google Translate brings "rischio di 100% liberamente" that means "risk of 100% freely". LOL
I suggest people in the NG have the D site's front page autotranslated into their language. I just say no to Russian translation. Some extracts translated back into English:
"Michael the Great is the only thing I need."
"Segfualt D is the language of systems." (I like this one:))
Portablility turns into mobility, of course...
"metaprogramming styles" - "styles of the zodiac"...
How about other languages?
|
Copyright © 1999-2021 by the D Language Foundation