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!
Just go on Google Translate and paste the URL to translate in the left box. Select your target (and source) language and click on the resulting link in the right box. You will be redirected to the translated website in the desired language. The URL can be shared with others to share the translated website.
I believe this page is what you're looking for.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With