Configuring Multiple Languages in the Enterprise Products

Problem:

I need information on setting up multiple languages in the all Enterprise editions and all post 3.0 versions.



Solution:

This article makes the assumption that you have become familiar with the pages, page modules, and templating in the Enterprise product.

Important notes:

Creating a multi-language site with our software is very easy. The first thing to find out is which language do you wish to be the "dominant" language for your site. If you wish a language other than english to be the dominant language we would recommend that you create another language within the language/text administration. When you create another language the language that currently has language id 1 will be duplicated. When the software comes to you english will have language id of 1. If you want 3 separate languages for your site create the three languages first. If you want english to be the dominant language of your site leave engish as language id number 1 and translate the other languages. If you wish another language to be the dominant language translate the language that has language id number 1 into the dominant language and leave any secondary language as english...if you still want english used on your site.

We recommend that you always keep an "english" language within the language admin (even if it is not live). This gives you a possible reference in speaking with Geodesic Support as we only speak english.

Your software has a "root" file. In older installations this might be classifieds.php or auctions.php. In newer installations it will be index.php by default. Of course you can change this to anything that you wish by changing the file name and the references to that file name within the SITE SETUP > GENERAL admin tool.

For this article we are going to use index.php as the example root file.

This article also assumes that you were able to create the language in the admin. You can add new language sets within the languages admin tool.

When a new language is added within the language admin tool, the software duplicates all text from language id 1 (the language that came default with your installation) to create the new language. Hint: It is best to set the site up completely with a single language first to minimize the translation with any new languages. Creating the new language also creates "space" within each page to edit the newly created text as well as assign page templates to the new language for each page. What the software does not do is duplicate the template assignments. This is not done because the templates are designed for the English Language and the software assumes that you will create new templates for the new language. So the next step is to create new templates for the new language. Once this is done you will need to assign the new templates to the pages for the new language. So each page will have two templates assigned. One for the initial language and another for the second. Please note that currently language specific html modules. You will need to use a new set of html modules for the second language if you use html modules within your page templates.

To switch between languages on the client side you will need to link into that page. A link is not automatically generated if a second language is created. The form is found as www.yoursite.com/index.php?a=21.

Immediately after creating a second language and browsing pages on the client side you may see a typical error like:

template configuration issue - check template assignment on this page 5

This error is being generated because no template has been assigned for this page for the new language.

Ex: Let's say that you create a second language in the admin. Then go to the form on the front side at index.php?a=21 and switch to the new language. You will likely see the above error because no template has been set for this page for the new language.

The built in language choice page rests at "?a=21" like so:

http://www.mysite.com/index.php?a=21

You will see the language choice form allowing the client to choose the language they wish to see the site in.

You can also create links that will change the language for you instead of pushing the client through the language choice form. Find the id of the language you wish to change to within the language admin tool. The default language that comes with your installation is "1" and cannot be removed from the site. All other languages added after that obtain their own id. For example to change to language id 3 you can use a link like that below.

http://www.mysite.com/index.php?set_language_cookie=3

Change the "3" to the language id of the language you wish to change to and you should be able to use this as a "language" link within your templates (enterprise only) or html to change the language the site is displayed in with one click.

When a user comes to your site the script sets a cookie with the default language. This cookie has a life of one year. The user can change their language at any time through your site language choice screen. This will be saved within the cookie and until their cookie expires they will see the language they chose.

If all else fails and the language cookie can not be set the language that has language_id of 1 will become the language that user will see your site in. Thus the reason we say to make your dominant language the first language in the language list within the language administration.


Properties ID: 000068   Views: 3352   Updated: 3 years ago