
kk krish wrote...
Does this worked "http://teknopoint.us/internationalization-of-adobe-cq5-authoring-i18n/" I have followed the same steps. but it is not able to fetch the I18N label values with the key name. instead it displays the key name itself treated as the value for the dialog widget and shows in the dialog. any inputs for implementation.?
It worked for me but only after made sure the locale is loading properly for language pages. Do this test.
Browse the page where you have this component , open the browser console and run Granite.I18n.getLocale(). It should give "fr" or "de" or whatever language you are looking for.
One strange thing i noticed is if we have /cf# in the URL , Granite.I18n.getLocale() always returns "en" and if i remove /cf# from the URL , Granite.I18n.getLocale() gives the correct locale string.
If the locale is not set properly, make sure you set the language for the page in page properties and set the locale from the request by code in the page component like below
<%@include file="/libs/foundation/global.jsp" %>
<%@ page import="com.day.cq.i18n.I18n, java.util.ResourceBundle,java.util.Locale" %>
<%
Locale pageLang = currentPage.getLanguage(false);
ResourceBundle resourceBundle = slingRequest.getResourceBundle(pageLang);
I18n i18n = new I18n(resourceBundle);
%>
<script>
Granite.I18n.setLocale("<%=pageLang%>");
</script>
Hope this helps.