How to pass the locale from forms afAcceptLang to our custom component JSP? | Community
Skip to main content
Level 4
June 7, 2021
Solved

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

  • June 7, 2021
  • 2 replies
  • 855 views

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.
Best answer by Pulkit_Jain_

@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

Pulkit_Jain_
Adobe Employee
Pulkit_Jain_Adobe EmployeeAccepted solution
Adobe Employee
June 8, 2021

@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!

 

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

Greetings.