[opencms-dev] Multilingual sites - Browser's AcceptedLanguages

Peter Olsson s.o.peter.olsson at telia.com
Sat Jul 15 01:35:59 CEST 2006


Hi again!

I'm now in the next step towards using OpenCms for a multilingual site. 
And that is the navigation.

If I had chosen a solution with siblings I guess this had worked just 
fine by setting the file properties Navigation Text and Title for the 
different siblings. But now I didn't :-)

Have any of you any experiences in this area you could share?

I have seen suggestions about using both ResourceBundles and define new 
properties for each language in the files (Title_de, Title_sv, ...). But 
since I'm still unexperienced with OpenCms I can't yet see what the 
consequences of the different solutions are in other parts of OpenCms.

My idea is that the navigation should be translated in a process of its 
own. That is, the navigation should be available in the chosen language 
even if the file/folder it links to isn't yet translated.

/Peter

PS: The solution with a new LocaleHandler seems to work fine and I 
choose to made the locale of a file, if it is defined, have precedence 
over the browser's Accept-Locale setting. Therefore it also work with 
the sibling approch. I made it as a module and there where no need to 
change and recompile the core.

PS 2: The site http://www.jugglingdb.com/ have a similar approach to 
what I want OpenCms to fix for me.

Peter Olsson wrote:
> Hi,
> 
> I found an earlier posting about this with the code for an alternative 
> LocaleHandler 
> (http://mail.opencms.org/pipermail/opencms-dev/2004q4/014031.html) which 
> gives the behavior I want. That is, the locale from the Accept-Language 
> setting of the browser is used if it is one of the configured languages. 
> I also get the functionality for the user to set the preferred language 
> explicitly.
> 
> But is this the right path to go?
> Or can this be done in some other way?
> 
> I also get an automatic fallback if there is no translation of a 
> specific element in the preferred language of a page. That is, the 
> elements that are not translated will be in English.
> 
> /Peter



More information about the opencms-dev mailing list