Open page with respect to Client browser's Language | Community
Skip to main content
Ratna_Kumar
New Participant
December 1, 2015
Solved

Open page with respect to Client browser's Language

  • December 1, 2015
  • 4 replies
  • 1717 views

Hi,

We need a requirement like, CQ page must open in the Client browser's language. Suppose for example, if someone from Spain open the site, it must shown in the Spanish language. If for some odd-reason, client browser's language is unavailable, it must directs to English.

Can anyone, please let me know, how to achieve for this requirement.

Thanks,
Ratna Kumar.

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 Jitendra_S_Toma

Hi Ratna,

The ideal solution would be to use apache rewrite rules to redirect sites based on language. I am not very sure if Internationalization could solve your problem. Internationalization is basically to render content based on key & native language.

it is like Java Resource bundle API. Pass the key & get the appropriate message.

You might have different domains for different language so apache rewrite to identify user language (From http request, accept-language parameter) and then redirect to respective domain.

--

Jitendra

4 replies

Jitendra_S_Toma
New Participant
December 2, 2015

Ratna,

Still not very clear how are you want to use that browser language. Do you want that at the server side or client side?.

In order to get language at client side, use navigator.language.And, at the server side, you can get it from http request header (i.e accept-language).

--

jitendra

Ratna_Kumar
New Participant
December 1, 2015

Hi Jitendra,

Actual requirement is this

"By default it uses the client browser’s language and it select the appropriate language. If for some odd-reason the client browser’s language is unavailable it defaults to “English".

Thanks,
Ratna Kumar.

Jitendra_S_Toma
Jitendra_S_TomaAccepted solution
New Participant
December 1, 2015

Hi Ratna,

The ideal solution would be to use apache rewrite rules to redirect sites based on language. I am not very sure if Internationalization could solve your problem. Internationalization is basically to render content based on key & native language.

it is like Java Resource bundle API. Pass the key & get the appropriate message.

You might have different domains for different language so apache rewrite to identify user language (From http request, accept-language parameter) and then redirect to respective domain.

--

Jitendra

Ratna_Kumar
New Participant
December 1, 2015

Can this can be done through Internationalization in CQ?: http://www.aemcq5tutorials.com/tutorials/implement-internationalization-in-adobe-cq/ 

Thanks,
Ratna Kumar.