How to pass the locale from forms afAcceptLang to our custom component JSP? | Community
Skip to main content
Level 4
Jun 7, 2021 1:20 AM UTC
Solved

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

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); %>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Pulkit_Jain_
Pulkit_Jain_Accepted solution
Employee
Jun 8, 2021 12:17 PM UTC

@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-editor-technical-video-setup.html?lang=en#prior-to-aem 

 

Hope this helps!

 

2 replies

New Participant
Jun 12, 2021 3:48 PM UTC
It's what I needed, thanks for the input. I need this type of information for my sublimation fabric business.

Greetings.
Translate
Pulkit_Jain_
Pulkit_Jain_Accepted solution
Employee
Jun 8, 2021 12:17 PM UTC

@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-editor-technical-video-setup.html?lang=en#prior-to-aem 

 

Hope this helps!

 

Translate