Hey,
I have this wierd problem with Click running on Windows and using the
wrong Locale.
- When the user enters the welcome page (index.htm), Click reads the
locale from the request, which is the browser setting, in my case "nl"
(Dutch).
- As the user logs in, his application settings are read form the
database and the user's preferred language is retrieved, which is set to
"en" (English)
- The Locale is saved on the context directly after the login:
getContext().setLocale( user.getPreferredLocale() ). Under the hood this
sets a session attribute.
- When the login process is complete, the login method redirects to
HomePage.class
- When the homepage is rendered, it is in "nl" and not in "en".
I have done some testing and the reason it is "nl" is that it is the
Windows box regional setting on the server. Which is very strange since
I have explicitly set a Locale on the Context. Still Click chooses "nl".
When I set the Windows regional settings on the server to "en", the
pages will show up in English.
I have entered all my captions in English in click-page.properties. Then
I made variations like click-page_nl.properties,
click-page_se.properties, you know, following the standard
ResourceBundle strategy. So I would think that even if Click fails to
find click-page_en.properties, it would fall back to
click-page.properties. But it doesn't. It chooses the
click-page_nl.properties because the regional settings are Dutch.
Can anyone shed some light on this?
Cheers,
WarnerJan