[opencms-dev] Frontend/Website Localization

Thorsten Duhn duhn at regio-gmbh.de
Thu Nov 14 16:24:19 CET 2013


Hello,

thank you, that <cms:bundle /> did the trick - almost. I'm still facing 
some strange problems, but I see progress. Maybe you have an idea on 
this: Now what I see is that messages in main.jsp are always English 
while messages in an included element jsp reflect the locale, which is 
defined on the root folder (I created them also called 'de' and 'en'). 
cms.locale also reflects this setting. Just messages come from English 
bundle instead of German (on English page they're also the English 
ones). Publishing, re-initializing is no help - but logghing of is, or 
looking at the online site.

Thanks,
Thorsten

> Hi,
>
> version 9 introduces a new resource type: xmlvfsbundle that offers the
> capability to edit message keys using the XML content editor. More over
> those messages will be available at runtime (compared with Java property
> files this is a real benefit).
>
> In order to use those bundles in JSPs, you have use <cms:bundle>-Tag
> instead of <fmt:bundle>-Tag. Here a code snippet:
>
> [...]
> <fmt:setLocale value="${cms.locale}" />
> <cms:bundle basename="com.alkacon.bootstrap.schemas.blog">
> [...]
>      <fmt:message key="bootstrap.blog.message.readmore" />
> [...]
> </cms:bundle>
> [...]
>
> HTH
> RĂ¼diger
>
> -------------------
>
> RĂ¼diger Kurz
>
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
>
> Am 14.11.2013 11:08, schrieb Thorsten Duhn:
>> Hello,
>>
>> as the "Frontend/Website Localization" chapter is still empty in 9.0.0
>> documentation and I cannot see how it works just on looking at bootstrap
>> example (and cannot find another information source). I would like to
>> ask if someone may explain it to me. Is there a way to use "XML Resource
>> Bundle" to store translations for use in template files? How to name,
>> where to store, how to use? If not, what is the intended way to store
>> translations and are steps like reinitialisation of workspace still in
>> need after updates or additions in bundles?
>>
>> In my template module I created and filled
>> "\{my.template}\i18n\{my.template}.messages"
>> and in my main.jsp I use
>> <fmt:setLocale value="${cms.locale}" />
>> and then stuff like
>> <fmt:message key="my.template.title" />
>>
>> All I get is "???my.template.title???".
>>
>> Do I need to add some configuration somewhere?
>>
>> Regards,
>> Thorsten





More information about the opencms-dev mailing list