Grails

switching the apps locale with ?lang=XX Parameter is not working on the index.gsp page

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.3.7
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    grails 1.3.7, jvm 1.6.24, kubuntu 10.04.2 LTS

Description

Switching the language with the lang parameter does not work on the landing page.
It simply picks up the browsers language setting.

I attached a simple sample project including a index.gsp with a simple second header.

<h1><g:message code="app.welcome.label" default="Welcome to the app"/></h1>

and the corresponding bundle entries in german and default.

Issue Links

Activity

Hide
Sabst added a comment -

Even if this is flagged as a duplicate of GRAILS-3871, there are many more details in GRAILS-3871, including suggestions for documentation.
In my case, the default locale of the system where the server is running is not English. In that case, there is no way to get the English version using ?lang=en from the browser (and whatever the browser settings are).
To fix that, I had to copy (or link) messages.properties to messages_en.properties
It should also be mentioned that you need to repeat this if you need, for example, en_US to work too.
I'm using 1.3.7 as well.

Show
Sabst added a comment - Even if this is flagged as a duplicate of GRAILS-3871, there are many more details in GRAILS-3871, including suggestions for documentation. In my case, the default locale of the system where the server is running is not English. In that case, there is no way to get the English version using ?lang=en from the browser (and whatever the browser settings are). To fix that, I had to copy (or link) messages.properties to messages_en.properties It should also be mentioned that you need to repeat this if you need, for example, en_US to work too. I'm using 1.3.7 as well.

People

Vote (1)
Watch (0)

Dates

  • Created:
    Updated:
    Last Reviewed: