views:

29

answers:

1

If I set the client locale in a GWT application by inserting the following line into the header of the main html/jsp file:

<meta name="gwt:property" content="locale=af_ZA">

This works nicely client side and I can make use of the built in i18n support for GWT.

But how can I read this locale again from the server side. I have tried using calling getLocale() on the HttpservletRequest but this does not give me the desired result (tt returns en_US which I think is probably the browser locale instead).

+2  A: 

You must post your locale to server by your self. Server side dosn't know anything about clients locale.

You can:
1) manually add a new property in your session
2) when you enter MainEntryPoint you can pass it via GWT-RPC and then store it in your server side
3) every time you send request you may also post your locale as a parameter

kospiotr