In Geometrixx footer (apps/geometrixx/components/page/footer.jsp), some text is displayed using i18n.get(). Like for example:
<p><%= i18n.get("We would like to keep in touch with you. Sign up here to receive our monthly newsletter on the latest products and services from Geometrixx.") %></p>
When I display a translated page, for example in french, I expect to get the french version of the i18n text. However, whatever the language, the english text is still being displayed.
I tried different texts, make sure the text exists and is correctly translated with the CQ Translator tool, activated and re-activated the page,... tried with other pages, ... always the same result, I'm unable to get the translated version.
What am I doing wrong? or missing?
Any help greatly appreciated. Thanks!
Where ever the I18N class is instantiated use the below code snippet to instantiate I18N object e.g. say in footer.jsp of geometrixx ofcourse with all imports using <%@ page import="com.day.cq.i18n.I18n, java.util.Calendar, java.util.Locale, java.util.ResourceBundle" %>
Locale pageLocale = currentPage.getLanguage(false);
ResourceBundle resourceBundle = slingRequest.getResourceBundle(pageLocale);
I18n i18n = new I18n(resourceBundle);
Hope this helps!
Thank you very much for your help. It solved my problem.
I now must find why the I18n i18n = new I18n(slingRequest); code does not get the correct language in my case.