Multiple languages



Website pages can display in multiple languages using tools provided by Google.

Google Translate is an application which can automatically translate your website pages into different languages. The translations are of a high quality and the service is constantly improving.

The home page at this website displays a Google translation tool, with the website pages automatically translated into any one of several languages when an appropriate flag image is clicked. Double click the browser back button to return to the original English version of the page.

If required, the tool could quite easily be changed to translate the site into even more languages. Clicking on the more languages link takes visitors to a relevant Google page where other languages can be selected.

Offering a choice of multiple languages is an excellent service to provide to visitors who may be accessing your website from any one of more than 200 countries around the world.

The code used to create the translation feature is shown below.

If you copy and use this code, change the website name shown near the top of the code, from http://www.your-website-name.com to display your website URL.

Also, copy the flag images from the home page of this site by right clicking each image in turn and selecting from the displayed menu to save the image to your computer.

You could if you wish, rename the flag image files, and then upload the renamed files to your own Solo Build It website account using the Quick Upload It! feature.

Next, change the relevant parts of the code below, which are highlighted in red, so that the flag images are called from your website account and displayed in the translate tool.

I suggest you experiment with setting up the Multiple Language tool code in a raw html block on a test page within your BB2 account.

Once you have set up the code correctely and tested it by building and viewing your test page in a regular browser, and have used the language tool to translate your website. Then, copy your unique version of the code from the test page and install it on the home page, or on another page at your website.

Note that the translate tool will not work correctly in the BB2 preview window. This is because the Google Translate system will not know which page you are attempting to translate. The tool will however work correctly when your page is published to the Internet and viewed in a regular web browser.

The code

<form action="http://www.google.com/translate">
<input name="u" value="http://www.your-website-name.com" type="hidden">
<input name="hl2" value="en" type="hidden">
<input name="ie2" value="UTF8" type="hidden">
<input name="langpair" value="" type="hidden">

<input name="langpair" value="en|zh-CN" title="Chinese Simplified" src="http://www.your-website-name.com/image-files/chinese-simplified.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|fr" title="French" src="http://www.your-website-name.com/image-files/french.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|de" title="German" src="http://www.your-website-name.com/image-files/german.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|it" title="Italian" src="http://www.your-website-name.com/image-files/italian.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<br>
<input name="langpair" value="en|ja" title="Japanese" src="http://www.your-website-name.com/image-files/japanese.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|ko" title="Korean" src="http://www.your-website-name.com/image-files/korean.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|ru" title="Russian" src="http://www.your-website-name.com/image-files/russian.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<input name="langpair" value="en|es" title="Spanish" src="http://www.your-website-name.com/image-files/spanish.gif" onclick="this.form.langpair.value=this.value" height="20" type="image" width="30">
<br>
<a href="http://www.google.com/language_tools" target="_blank"> More languages</a>
</form>

If your website is originally displayed in a language other than English, you will also need to make relevant changes to those parts of the code which are highlighted in blue. This will then inform the Google Translate application, which language is used for the original text at the site and which language to translate the text into.

One challenge with translating a website into multiple languages, is that translating the site to another language will often distort the detailed page layout. This is because some languages require more words and require words of different lengths to express ideas or describe features.

This is especially noticeable if you translate a site from a language which is written from left to right such as English, to a language which is written from right to left such as Arabic.

There appears to be little that can be done to prevent this type of distortion other than designing the website layout to accommodate the display both left to right and right to left languages .

The multiple languages translation tool used on this website is not the only one available. In fact it is now probably quite dated and was first used on another website that I built several years ago.

I copied the code from that website and used it on this site, making relevant changes to those parts of code highlighted above in red.

Conduct research at Google to learn about more recent versions of the translation application.

Return to the top of the multiple languages page.

Return to the website content page.




















































































Article by ©