[opencms-dev] multi-language pages in 5.3.4

Alexander Kandzior alex at opencms.org
Thu May 13 08:54:01 CEST 2004


Martin,

regarding the multi-language settings in 5.3.4:

> Good, that works. But when I export the folders (I have to
> set property "export" to "true" on the folders, why ?)
> the file that is supposed to be german has the english
> content in it. Is it a bug or is it supposed to be that way ? 
> Or do I have to set something else ?

I don't know without further investigation, but it should work. It may be a
misconfiguration or a bug. 
 
> Also, without the static export, is it possible to serve
> the correct language version based on browser's 
> Accept-Language: header ?

Yes, it will require programming a locale handler that does this, but this
is pretty easy. The configured handler is set in opencms-system.xml:

<localehandler class="org.opencms.i18n.CmsDefaultLocaleHandler"/>

Have a look at the source code of this class, it just searches the "locale"
property. Writing your own version that uses the Accept-Language header
would be easy, since we even have a class 

org.opencms.i18n.CmsAcceptLanguageHeaderParser 

already available (which is used by the workplace). Check the code of 

org.oepncms.workplace.CmsWorkplaceManager 

which also implements a locale handler for the Workplace and look at the
method 

public CmsI18nInfo getI18nInfo(...) 

which already uses the Accept-Language header as fallback if the user logs
in for the first time. From there creating a locale handler should be pretty
straightforward.

Best Regards,
Alex.

Alexander Kandzior
Alkacon Software - The OpenCms Experts
http://www.alkacon.com




More information about the opencms-dev mailing list