Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

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

Avatar

Avatar
Validate 1
Level 2
1asdfasdfadsfasdfasdfa
Level 2

Likes

3 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Give Back 3
Boost 1
Give Back
View profile

Avatar
Validate 1
Level 2
1asdfasdfadsfasdfasdfa
Level 2

Likes

3 likes

Total Posts

12 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 3
Give Back 3
Boost 1
Give Back
View profile
1asdfasdfadsfasdfasdfa
Level 2

06-06-2021

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

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Affirm 25
Employee
PulkitJain
Employee

Likes

59 likes

Total Posts

62 posts

Correct Reply

27 solutions
Top badges earned
Affirm 25
Boost 50
Give Back 10
Establish
Boost 25
View profile

Avatar
Affirm 25
Employee
PulkitJain
Employee

Likes

59 likes

Total Posts

62 posts

Correct Reply

27 solutions
Top badges earned
Affirm 25
Boost 50
Give Back 10
Establish
Boost 25
View profile
PulkitJain
Employee

08-06-2021

@1asdfasdfadsfasdfasdfa 

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!

 

Answers (1)

Answers (1)

Avatar

Avatar
Level 1
lena01
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile

Avatar
Level 1
lena01
Level 1

Likes

0 likes

Total Posts

1 post

Correct Reply

0 solutions
View profile
lena01
Level 1

12 hours ago

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

Greetings.