ez.no / exponential / documentation / configuration / configuration / language and charset / how to setup a multilingual...
Exponential 3.1+ has made multilingual site implementation rather easy, though it is not straight forward or well documented. This document is an attempt to begin to systematize the knowledge and experience surrounding multilingual websites and offer a space whereby others can contribute to the community documentation. I am a relatively new ezp user and will try to make this as user-friendly as possible. This document respresents a compilation of notes, documentation, forum messages and experiences.
I have broken down the aspects of multilingual websites into the following categories:
Exponential 3 makes managing a MLW easy from the admin area. The tricky part seems to be in getting it set up correctly and then being able to display the content as desired. Based on what others have tried, there seem to be two general approaches to the former in exponential3. The first is the method that was built into ezp3 and primarily involves configuring exponential (through the siteacess and site.ini settings) to display the appropriate language based on the url address. The other method involves the use of information gathered from the user naviagating the site and depends on the use of modules not currently included with exponential. As I do not know of any public modules and want this to be as accessible as possible, I will focus on the former (siteacess) method.
Once the MLW is setup, administering a multilingual site (done through the admin area) involves two main tasks:
Translations are not versioned independently. If you want need that feature, it is recommended that you use different objects for different languages. You can then link the objects to their counterpart in other languages using the related objects function (also in right-hand menu). Also, this solution has advantages if your multilingual site has certain workflow demands. For example, having separate content objects for each language is also the best solution if you want translations made while the main language is published. In this case, the site manager would tell the translators to copy the original object and create the translations.
Please note that in version RC2 of exponential3, there was a bug where you would get no translations if the current language was placed before the others in the translation list.
When you first install exponential, the setup and installation tool lets you chose to make your site multilingual (and also which language should be the principle language for your site). If your translation does not ship with the exponential distribution, install it before installing exponential (see below).
There are many translations for the exponential administration area available. Please see links below to find your translation and for instructions on how to easily install a translation. If you install the translation before installing exponential, the setup wizard will automatically configure the admin area to your preferred language and configure the site to allow all your other chosen translations for text. It is advisable, though not necessary, to setup the multilingual site at the installation because it is easier and helps avoid database errors that can be caused by changing language configurations.
If you install translations after your initial setup, you can still set up the site as multilingual. After you download and uncompress the translation files, you should set configurations according to your preferences (principal language, admin area language, etc). By setting your Locale variable, you can deploy the prefered language for the site admin area. By setting the ContentObjectLocale, you set the language for the content you develop. If you are unsure, do not change the later.
Where to get translations
How to install a translation or here.
The site access settings let exponential receive configuration information based on the url address that is passed to it. So that exponential knows which language to present, we must configure the site access settings to present content in a certain language based on the url. The way this is done for multilingual sites is the same as for hosting several sites on one exponential installation (the difference being you do not necessarily have different content architecture in MLW). There are several ways this can be done in site access (see all of them at here).
I describe the process in three steps:
Step by step:
A typical, simple configuration (though not the only) for a multilingual site is to have each language have a distinct directory after the main address to access a certain language (ie, site.com/index.php/en, site.com/index.php/es, etc). To configure this setup, we start by editing settings/override/site.ini.append with (some of this may have been done for you during the installation, adjust as necessary):
[SiteAccessSettings] #this part tells how the site access setting is chosen, in this case, by the uri MatchOrder=uri URIMatchType=element URIMatchElement=1 URIMatchRegexp=^/([^/]+)/ URIMatchRegexpItem=1 #this part tells ezp which siteaccess folders are available AvailableSiteAccessList[]=en AvailableSiteAccessList[]=es AvailableSiteAccessList[]=br AvailableSiteAccessList[]=admin DebugAccess=enabled [RegionalSettings] #allow translations TextTranslation=enabled #cache the translations, can be disabled if desired (can take a long time the first time the language is accessed) TranslationCache=enabled [ContentSettings] #translations available for the content TranslationList=eng-US;esl-ES;por-BR #you can enable this after you have everything setup, leave it disabled to see if you did it right! ViewCaching=disabled
That is it! Some alternative setups are possible too (each of these change slightly the SiteAccessSettings configuration shown above). Again, see the site access documentation to figure out how:
- Virtual host (www.site.es, www.site.br or www.en.site.com, www.es.site.com, etc)
- Index (index_en.php, index.es.php)
Create one siteaccess folder for every language. The configuration files in these folders give exponential the correct language settings when the site is accessed. The folder names must be the same as the url directory name setup in step 1. In this example (site with English, Spanish and Portuguese), the resulting folders look like this:
settings/siteaccess/en (English) settings/siteaccess/es (Spanish) settings/siteaccess/br (Portuguese)
(note*this may be in addition to your admin folder and configuration, which can also be configured with language information)
In each folder create a site.ini.append.php file. In the site.ini.append.php you can specify any number of values to differ from the main/default setup, such as different design folders, languages, login preferences. Take a look at settings/siteaccess/demo/site.ini.append and settings/siteaccess/admin/site.ini.append for examples. Whatever your other configuration decisions, the crucial part for multilingual is to set the Locale and ContentObjectLocale you want to use for that specific area of your site. For example, in my example case, the primary language is Spanish (for admin and user area, which are set in the settings/override/site.ini.append file). For the English part of my site, I edit settings/siteaccess/en/site.ini.php to have:
[RegionalSettings] Locale=eng-US HTTPLocale=en ContentObjectLocale=eng-US
Next do the same for each respective siteaccess/whateverlanguage/site.ini.php file.
Text translation is automatically disabled when the Locale is set to eng-GB in settings/site.ini. Since we will need text translation, we have to change these variable settings in the settings/site.ini (otherwise the above work will not take effect). In settings/override/site.ini.append(.php) you can't override Locale, HTTPLocale and ContentObjectLocale; these are set in the siteaccess ini files. So first, in the settings/site.ini file, we comment out the following parts (with the '#' mark):
[RegionalSettings] #Locale=eng-GB #HTTPLocale= #ContentObjectLocale=eng-GB
Fine tuning
If you are setting up several sites with one Exponential 3 installation using site access, you might want to separate the cache and storage directory. This will make things less cluttered and easy to manage when having many sites per installation. The default settings in Exponential 3 stores cache and files in a common directory for all sites. This can cause problems if you e.g. want to move one of the sites to another server in the future. This can be changed by setting some variables in your site.ini.append for each of your sites.
It is important that both the user and the admin site has the same storage directory. Otherwise if you e.g. upload a new file using the admin site, the user site will not be able to locate the file because it is looking for it in the wrong directory. Also, make sure that Apache has sufficient rights for the folders you create.
For example - separate storage files and cache for 'site.com/es', 'site.com/en', 'site.com/br' and 'site.com/admin'.
Please seen the original of this
Non latin languages and unicode:
If you need a language that does not use the latin character set, you will have to change this in settings/i18n.ini which defines the core charset for the site. With UTF-8 (Unicode) you can get most languages in the world on the same site at the same time.
Log in or create a user account to comment.
Comments
It doesn't work!!!
raul raul
Monday 23 January 2006 8:34:14 pm
Sorry about my poooor english! Thanks!!!
Language Selector
Neil Dewkinandan
Friday 04 February 2005 6:17:19 pm
but how to keep the language stored
Babak Fakhamzadeh
Tuesday 01 February 2005 12:52:38 pm
I used the code supplied in the comments to create a language selector. Works like a charm.
However, after changing the language and clicking away, the language of the site defaults again to the default language.
How to store the language selected by a user?
Thanks,
Babak Fakhamzadeh
That tip how not to use siteaccess is excellent
Andrei Maistrenko
Thursday 02 December 2004 6:45:51 am
Displaying languages when siteaccess is not used
Kjell Knudsen
Friday 03 September 2004 1:14:28 pm
yes something fishy
Delchina Angelova
Monday 09 August 2004 8:54:27 pm
Also read other articles in forum in each had something different not mention in the other, I followed all and as a result website start to show setup page fine tune etc.
So where i can find "Correct" manual how to add 2nd language, i have 1 language Ez Publisher works fine and wand to add 2nd.
Everywhere is writen how from 2 languages to add 3rd may be there is the fishy part i dont know.
Would be nice if someone solve this issue.
what's wrong?
Alessandro Cipriani
Tuesday 13 January 2004 12:43:08 pm
i followed this article but i was not able to make my site work
i already have a site "overriding" the existing corporate site on my own computer (I access it through localhost/index.php/corporate).
now i need to make it multilingual.
so i have only a design folder (corporate) and 3 siteaccess folders (corporate, en [english version], it [italian version]).
i copied the siteaccess site.ini.append file from the corporate directory to the en and it directories and i changed only the regional settings ([databasesettings], [sitesettings] and so on are the same).
it doesn't work properly when i try to access the italian (or english) site by the url: "localhost/index.php/it" ("localhost/index.php/en"). i get the kernel 50 error ("No database connection could be made, the system might not behave properly.") and the login form. the only thing working properly is the login form language (italian accessing /it, english accessing /en). any hint? thanx a lot