Issue Details (XML | Word | Printable)

Key: GRAILS-1147
Type: Bug Bug
Status: Closed Closed
Resolution: Won't Fix
Priority: Critical Critical
Assignee: Graeme Rocher
Reporter: Sonny To
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

changing locale by passing in lang param only changes locale for the request and not the whole session

Created: 14/May/07 10:05 AM   Updated: 11/Jun/09 11:28 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.6-RC1

Time Tracking:
Not Specified


 Description  « Hide
the lang parameter only set the locale per request. cookie must be set also for locale change to be persistent for the session
Need to change I18nGrailsPlugin.groovy. Add cookieName = "lang" as follows at end of doWithSpring closure:

localeResolver(CookieLocaleResolver) { cookieName = "lang" }



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Sonny To added a comment - 07/Jun/07 01:43 AM
The suggested fix requires you to directly manipulate the lang cookie.

CookieLocaleResolver is not working properly. Change to SessionLocaleResolver. works as expected.
SessionLocaleResolver can be configured in spring/resources.xml or this plugin can be changed to use the SessionLocaleResolver instead of the CookieLocaleResolver


Graeme Rocher added a comment - 07/Jun/07 05:13 AM
Ok changed to use session one

Sonny To added a comment - 28/Jun/07 06:18 PM
only works with .gsp located in view directory. index.gsp in root does not work

Graeme Rocher added a comment - 03/Aug/07 05:22 PM
Add a URL mapping to redirect to a controller:
"/" {
	controller = "book"
  }

Soon we may make it possible to do:

"/" {
	view = "/index"
  }

Christoph Lechleitner added a comment - 11/Jun/09 11:28 AM
>only works with .gsp located in view directory. index.gsp in root does not work
Actually locale changing only works with controllers, not with views.

The former comment refers to that but does not explain.
The according issue is GRAILS-3871.