Translate page using translate tool when redirecting from another (specific) page

175 views
Skip to first unread message

TradingDevDPH

unread,
Oct 1, 2013, 7:52:43 AM10/1/13
to google-tra...@googlegroups.com
Hello,

We have a web page on a .com domain. Let's call it www.mypage.com
It's implemented in 2 languages, english(en) and danish(dk), but it also has a Google Translate implementation that could translate the whole page to a number of other languages. 

We recently made another page, let's call it www.mypage.it, that only describes what kind of content we have in .com in italian language. 
Currently, all the links in the .it page redirect to the english version of our .com site.

We would like that every time we click a link inside the .it page, it will redirect to .com and automatically run the google translate implementation to translate the page to Italian.

We have the following code in our <head> tag (in .com):

<script type="text/javascript">
     function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
includedLanguages: 'el,ja,zh-CN,ko,de,es,fr,it,nl,no,ru,sv',
 layout: google.translate.TranslateElement.InlineLayout.SIMPLE
},
        'google_translate_element');
     }
</script>

We discovered that we could use the following parameter in an URL to make the destination page translate the content "#googtrans(en|it)".
It is used as www.mypage.com#googtrans(en|it) . However, it translates only parts of the page.

Another suggestion from a colleague was to implement a script in JS (in .com) that will check where the link was called from, and run the google translate tool locally.

My question is: what would be the best/standard way to implement a translation-on-redirect?
Any suggestions are welcome.
Reply all
Reply to author
Forward
0 new messages