I recently saw a website that used Google Translate in their page, but instead of using the widget, they listed the available languages via links. Click a link and it translates the page.
Has anyone ever done this? I tried to parse through the page to figure out how it was done but I don't see much different than when I use the widget. Here's some of my code:
<h3>Translate</h3>
<ul class="google-translate-six">
<li><a href="?/#googtrans(en|es)" title="View this site in Spanish.">Español</a></li>
<li><a href="?/#googtrans(en|zh-CN)" title="View this site in Chinese.">中文</a></li>
<li><a href="?/#googtrans(en|it)" title="View this site in Italian.">Italiano</a></li>
<li><a href="?/#googtrans(en|pl)" title="View this site in Polish.">Polskie</a></li>
<li><a href="?/#googtrans(en|ht)" title="View this site in Haitian Creole.">Kreyòl Ayisyen</a></li>
<li><a href="?/#googtrans(en|pt)" title="View this site in Portuguese.">Português</a></li>
<li><a href="?/#googtrans(en|en)" title="View this site in English.">English</a></li>
</ul>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({
pageLanguage: 'en',
autoDisplay: false,
gaTrack: true,
gaId: 'wewe',
layout: google.translate.TranslateElement.InlineLayout.SIMPLE
}, 'google_translate_element');
}
</script>
<script src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Thanks! The site I'm referring to is: https://www.baltimorecountymd.gov/index.html. The Translate section is at the bottom right portion of the page.
Thanks everyone!
http://example.com/
and a target language there ... and then look at the resulting URL, which parameter represents what is pretty obvious. – Derwent