Delivery Tier I18N support
If you want dynamic I18N support maintenable via the CMS, you should use Dynamic Resource Bundles.
I18N support in the Hippo's delivery tier (HST) is very simple. Take the following steps:
To the web.xml add:
<!-- I18N --> <context-param> <param-name>javax.servlet.jsp.jstl.fmt.localizationContext</param-name> <param-value>messages</param-value> </context-param>
To your src/main/resources add the I18N bundles, for example:
messages_en_US.properties
home.title=Home
messages_nl_NL.properties
home.title=Thuis
To the ' hst:hosts' add the default locale, for example:
/hst:hst/hst:hosts: /hst:locale: en_US
and to the Mounts that should have a different locale add the hst:locale as well, For example:
/hst:hst/hst:hosts/dev-localhost/localhost/hst:root/nl: /hst:locale: nl_NL
Now, in your templates you can use fmt:message tag without first setting the locale. This is done by the HST already. For example:
JSP
<fmt:message key="home.title"/>
Freemarker
<@fmt.message key="home.title"/>
Note that you thus should not use <fmt:setLocale value="some_locale" scope="page | request | session | application"/>. An exception is for rss feeds, as these always need the locale 'en-US' : <fmt:setLocale value="en-US"/>