Expand my Community achievements bar.

Dive into Adobe Summit 2024! Explore curated list of AEM sessions & labs, register, connect with experts, ask questions, engage, and share insights. Don't miss the excitement.

Custom RequestLocaleResolver

Avatar

Level 1

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?

2 Replies

Avatar

Level 4

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

Avatar

Level 4
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