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

Custom RequestLocaleResolver

Avatar

Avatar
Level 1
armandokg
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile

Avatar
Level 1
armandokg
Level 1

Likes

0 likes

Total Posts

2 posts

Correct Reply

0 solutions
View profile
armandokg
Level 1

22-01-2019

Hello, I wanted to to change the request locale based on which page it is trying to load, my approach was to create a custom RequestLocaleResolver and fair enough the request locale was change to the desired locale, now comes the tricky part. The whole idea behind this is to set the request locale so the i18n filter will use that locale to find the correct translation, when printing (in HTL) the value of request.getLocale().getLanguage() I get my previously defined locale (which is fine), and currentPage.getLanguage() returns the locale set in the jcr:language property.

My question is, how can I correctly override the locale in that scenario so that I get the translation I want based on the overridden locale?

Accepted Solutions (0)

Answers (1)

Answers (1)

Avatar

Avatar
Validate 1
Level 2
victor_toledo_3
Level 2

Likes

14 likes

Total Posts

39 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile

Avatar
Validate 1
Level 2
victor_toledo_3
Level 2

Likes

14 likes

Total Posts

39 posts

Correct Reply

4 solutions
Top badges earned
Validate 1
Ignite 1
Give Back 5
Give Back 3
Give Back
View profile
victor_toledo_3
Level 2

07-04-2020

Hi @armandokg ! have you resolved this problem? i had a similar one and would like to know what approach you used to change the jcr:language.

Thanks in advance