I need to get the translation for the key words mentioned below .i need a way to get the adobe internal library. Please let me know how to do it. I am using <fmt:message key="${keyword}" /> .
de_DE
es_ES
fr_FR
ja_JP
ru_RU
pt_PT
zh_CN
nl_NL
ko_KR
en
Solved! Go to Solution.
Views
Replies
Total Likes
Values stored in i18n can easily be accessed via java code. You need to get the locale object
<%@page session="false"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@page import="java.util.Locale,java.util.ResourceBundle,com.day.cq.i18n.I18n"%> <%@include file="/libs/foundation/global.jsp"%> <cq:setContentBundle/> <% final Locale pageLocale = currentPage.getLanguage(false); final ResourceBundle resourceBundle = slingRequest.getResourceBundle(pageLocale); I18n i18n = new I18n(resourceBundle); %> <%= i18n.get("cartItem") %>
Here are some helpful reference links as well:-
http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/
http://hootcook.blogspot.in/2013/02/cq5-internationalization.html
http://www.albinsblog.com/2014/12/implementing-internationalization-with.html#.Vf2L6X0po3Y
Views
Replies
Total Likes
Hi,
Also please take care of path where you should have language node, it should be
/content/project/langauge-node/wesbite-pages.
Your path doesn't follow this. Here is the Documentation for the same : http://docs.adobe.com/docs/en/cq/5-6-1/administering/multi_site_manager.html#Managing%20Different%20...
Views
Replies
Total Likes
Hi,
You can use translator page to edit values http://localhost:4502/libs/cq/i18n/translator.html
Views
Replies
Total Likes
But How to use it .For example The list above i have mentioned does not chage when i use say <fmt:message key="es_ES" /> to Spanish
Any inputs here how could i use it
Views
Replies
Total Likes
Values stored in i18n can easily be accessed via java code. You need to get the locale object
<%@page session="false"%> <%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn" %> <%@page import="java.util.Locale,java.util.ResourceBundle,com.day.cq.i18n.I18n"%> <%@include file="/libs/foundation/global.jsp"%> <cq:setContentBundle/> <% final Locale pageLocale = currentPage.getLanguage(false); final ResourceBundle resourceBundle = slingRequest.getResourceBundle(pageLocale); I18n i18n = new I18n(resourceBundle); %> <%= i18n.get("cartItem") %>
Here are some helpful reference links as well:-
http://blogs.adobe.com/dekesmith/2012/10/21/internationalization-within-sling-and-cq/
http://hootcook.blogspot.in/2013/02/cq5-internationalization.html
http://www.albinsblog.com/2014/12/implementing-internationalization-with.html#.Vf2L6X0po3Y
Views
Replies
Total Likes
<fmt:message> is not there with sling. as @edubey mentioned use i18n.get()
However, make sure you have all the dictionary built for the words you need.
Refer these which might help
1. https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/i18n-dev.html
2, https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n.html
3. https://docs.adobe.com/docs/en/aem/6-0/develop/components/i18n/translator.html
Views
Replies
Total Likes