views:

40

answers:

1

I've got a web app that I am working on, and I have each of my languages broken up into *_lang.properties. If I change the browser language, the appropriate language appears in the UI which is great, but it requires my browser (both FF and IE) to be restarted. Other websites recognize the language change with just a page refresh.

Is there something I am missing in order to not force a browser restart?

+2  A: 

Most probably the language settings are stored in the session on the server side. You should be able to change that part of the code responsible for loading resource bundles to always check the request headers to see which locale's resource bundle should be loaded.

Bytecode Ninja
OK - so your thinking is that right now the app only is checking the first time the browser loads and is setting some type of session? Your fix makes sense, just trying to see how this thing is thinking.
NinjaCat
If your application is multi-user and users have to login to it in order to access it, I assume that as soon as the user logs in, the server sets the locale for that user in the session and sticks to it till the user logs out. If your app does not require users to log in, as soon as you open it with a browser, it most likely assigns a session to the client either using a cookie or using URL rewriting and sticks to it till the session times out or the user closes the browser. Again, the serverside app only checks for the user's locale once during the first page hit.
Bytecode Ninja