[opencms-dev] localization in formatter?

Filip Kratochvil filip.kratochvil at nelasoft.cz
Tue Jan 6 10:47:17 CET 2015


Hi Dominic,

just take a look at demo formatters (e.g. /system/modules/com.alkacon.bootstrap.formatters/formatters/blog.jsp:)

Here is an example:

- you need to load fmt taglib at the start of your jsp

<fmt:setLocale value="${cms.locale}" />
<cms:bundle basename="name of the i18n localization file">
	<fmt:message key="name of the localization key" />
</cms:bundle>

<fmt:setLocale value="${cms.locale}" />
<cms:bundle basename="com.alkacon.bootstrap.schemas.blog">
	<fmt:message key="bootstrap.blog.message.readmore" />
</cms:bundle>

--
Regards
Filip Kratochvil
------------------------------------------------
NELASOFT Technologies, s.r.o.
E-mail: filip.kratochvil at nelasoft.cz
Web: www.nelasoft.cz
Twitter: @NELASOFT

-----Original Message-----
From: opencms-dev-bounces at opencms.org [mailto:opencms-dev-bounces at opencms.org] On Behalf Of Dominic Rothemel
Sent: Tuesday, January 06, 2015 10:38 AM
To: opencms-dev at opencms.org
Subject: [opencms-dev] localization in formatter?

Hello,

I want to translate my website in english and german. In my own formatter, I use text for labels shown on the website (this might be a bad idea, but I don´t know how to do better).
Now my idea was to use a i18n config file for these labels in english and german. But I can´t access these labels in my formatter.
How can I access these labels or would you advise a better way?

Thank you
Dominic
_______________________________________________
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