Expand my Community achievements bar.

SOLVED

How to pass the locale from forms afAcceptLang to our custom component JSP?

Avatar

Level 4

Hi, urgent help needed, I have a form using our custom component, in the custom component, we need to translate the error/confirmation messages based on the locale. But even I tested with a android emulator with local setup to Spanish, the locale I got from our JSP from slingRequest is still en.

How to pass the locale from form to JSP and client library?

Here's our code, the i18n always return en:

<%@include file="/libs/fd/af/components/guidesglobal.jsp"%>
<%@ page import="com.day.cq.i18n.I18n" %>
<%@ page import="com.adobe.aemds.guide.utils.GuideConstants" %>
<% I18n i18n = new I18n(slingRequest); %>

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

@DavidZhang 

Please review this video for more details on how to configure translation rules for a custom component - https://experienceleague.adobe.com/docs/experience-manager-learn/sites/translation/translation-rules... 

 

Hope this helps!

 

View solution in original post

2 Replies

Avatar

Correct answer by
Employee Advisor

@DavidZhang 

Please review this video for more details on how to configure translation rules for a custom component - https://experienceleague.adobe.com/docs/experience-manager-learn/sites/translation/translation-rules... 

 

Hope this helps!

 

Avatar

Level 1
It's what I needed, thanks for the input. I need this type of information for my sublimation fabric business.

Greetings.