[opencms-dev] Frontend/Website Localization

Thorsten Duhn duhn at regio-gmbh.de
Fri Nov 15 08:30:36 CET 2013


Hello,

again you're right, that works. I would consider it a little bug 
nevertheless. Also I still have problems for changes in bundle to apply 
on offline website. Reininitialize, clearing OpenCms caches etc. does 
not work, only after publishing the changed bundle the change got 
visible to offline site as well – but hey, this new XML bundle is by far 
better than Java bundles before (where in most cases a servlet restart 
was needed). Thanks.

Regards,
Thorsten


Am 14.11.2013 17:18, schrieb Rüdiger Kurz:
> Try to print out: ${cms.locale} and check if it is set to the right locale.
>
> My assumption is that ${cms} which is an instance of
> org.opencms.jsp.util.CmsJspStandardContextBean is not initialized in the
> main tamplate (a formatter initialized this by using  the
> <cms:formatter> tag).
>
> So try:
> <c:set var="locale"><cms:info property="opencms.request.locale"/></c:set>
> <fmt:setLocale value="${locale}" />
>
>
> Am 14.11.2013 16:24, schrieb Thorsten Duhn:
>> 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
>>
>>
>> _______________________________________________
>> 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/cgi-bin/mailman/listinfo/opencms-dev
>>
>>
>>
>





More information about the opencms-dev mailing list