So must of us have a lot of content on our sites in one language or another. Since we are web professionals we spent all that time we could have been learning human languages – instead learning computer languages. So we need someway to translate our content.
Google provides a translation service (among others) and so given their massive empire I am confident that they do (or shortly will) have the best translation service. With that in mind, what is the best way to use it? We could just be lazy and use the little widget that they provide – but we would lose all the content and SEO juice because google would rewrite the links to point to "translate.googleusercontent.com?translate=…".
So my question is – how we can use this service while retaining the translated content on our site?
One method would be to use the Google AJAX API to load the content inline when the wants it. But since it is powered by JS (like jQuery)- Search Engines won't benefit from this.
Another method would be to use a server side language (like PHP) to scrap the content from the google translate page. But I'm not sure this is 100% legal.
Finally, I was wondering about using mod_rewrite to fetch the page. But again, I don't think this would benefit our site.
RewriteRule ^(.*)-fr$ http://www.google.com/translate_c?hl=fr&sl=en&u=http://site.com/$1 [R,NC] RewriteRule ^(.*)-de$ http://www.google.com/translate_c?hl=de&sl=en&u=http://site.com/$1 [R,NC] RewriteRule ^(.*)-es$ http://www.google.com/translate_c?hl=es&sl=en&u=http://site.com/$1 [R,NC] RewriteRule ^(.*)-it$ http://www.google.com/translate_c?hl=it&sl=en&u=http://site.com/$1 [R,NC]
All you would need to do is add a a couple links on your pages with the variables “-fr” appended to the end of what ever URL is in the link and your set.
//View file View Page in <a href="<?php print $uri_string; ?>-de">German</a>
Does anyone have any thoughts on this?
After reading google's Terms of Service it seems that
You will not, and will not permit your
end users or other third parties to:
incorporate Google Results as the
primary content on your Property or
any page on your Property; submit any
request exceeding 5000 characters in
Which sounds to me like you can't use the google translate URL to translate the main content – with PHP or AJAX – if that content is the main post of the page. Now how does this work? Why would you build a translation API and then not allow it to be used on the main page content?
Well, you should read the EULA, maybe google doesn't want you to use their service in that way.
Not to mention that Google Translate may be fine across indo-european languages, but right now, translations to other families of languages really suck, and generate comical, meaningless text (e.g. my own language, Hungarian, is a nightmare for Google). I don't think it'll advance to an at least usable level in the near future.