[opencms-dev] multilanguage

Claus Priisholm cpr at codedroids.com
Tue May 22 10:16:42 CEST 2007


There is an archive you can search on opencms.org. You can also have a 
look at nabble.com since it indexes the contents of the mailing list as 
well.

The default way the multilanguage is handled is by using the approach 
you mention. You can alter this behaviour by adding your own i18n 
handling. There are examples of that in the archive.

The default way is as you fear to make "copies", but the intention is 
that you make them as what is called siblings. Basically a link/short 
cut so the contents of the file is only stored once. The XML structure 
is such that it is prepared to be store multiple language in one file.
But opposed to the contents of the file, the files properties and 
attributes are not localizable.
Hence by doing copies/siblings you get a file per language and thus you 
can set the title and other properties on these files according to the 
locale (as you can see from the archive this is a problem you will have 
to address if you implement a different i18n handler and cannot avoid 
having localizable content in the properties).

It is a workable solution and having separate folder hierarcies allows 
you different sites be structured differently (maybe you don't need all 
the pages from one language to also appear in all other languages).

But there are two drawbacks: since there is not sure way of knowing why 
a sibling exist, it is basically manual work to keep the various 
language hierarcies in sync. This can be tedious. The second problem is 
related to the way siblings works - since the contents is actually 
shared, there is just one version. So if an editor of one language 
publishes his sibling this will also publish the contents of another 
language. Of course this is how siblings must work, but just keep it in 
mind - if this does not fit your workflow you can make plain copies of 
the files rather than make siblings, but then some of the smart things 
like being able to edit multiple language simply by chosing a different 
language withing the editor is lost.

Jordi Martí wrote:
> Hello all,
> 
>  
> 
> I’m new in this list. If this question has been asked before, please 
> forgive be, but I don’t know how to search through the content of all 
> the previous mails… Is there any way to do it??
> 
>  
> 
> I would like to know if any of the list has had any experience setting 
> up a multilanguage site.
> 
>  
> 
> If so, what’s the best approach to do this?
> 
>  
> 
> I’ve been reading in OpenCms Wiki that:
> 
> / /
> 
> /To achieve a multi-language site in opencms it's a good idea to create 
> one top-level folder per language. These top-level folders are usually 
> named after their two-letter lowercase code as identified by the ISO 
> 639-1 list <http://en.wikipedia.org/wiki/List_of_ISO_639-1_codes>, 
> although you can name them however you want. On each of these folders, 
> the locale property should be defined. This can be done by left-clicking 
> the folder icon and selecting properties > advanced. In the advanced 
> properties the locale property should be listed. All the child folders 
> and pages will then inherit the locale of their parent folder. If you 
> would like a page to be available in several locales, you start out by 
> creating the page in one of the locale folders, after which you create a 
> sibling to this page in the folders of the other locales for which you 
> want this page to be available./
> 
>  
> 
> I’m not sure I understood it, but this scares me: should I have a page 
> replicated X times, and the user that sets up the information, this XML 
> information X times (being X the number of languages)?
> 
>  
> 
> Can’t I just have a page in which I want to show the content depending 
> the Locale the user selected??? Just a JSP and just a XML information 
> (its information replicated X times in X fields).
> 
> 
> For example, in my JSP:
> 
> <cms:contentshow element="Title" language=”en”/> (or it could 
> automatically get the language from the body)
> 
>  
> 
> I don’t know if I explained myself.
> 
>  
> 
> Thank you very much!!!
> 
>  
> 
> --- jordi
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev




More information about the opencms-dev mailing list