On Aug 23, 11:07 am, francescoNemesi <[EMAIL PROTECTED]> wrote: > Hi There, > > in my GWT application I am using GWT Constants and Messages to im > plement localisation... I know it si possible to change the the > locale by passing it to the URL or with a property in the html, but I > was wondering if there is a way for the application to honour the > user's browser locale, like "standard J2EE applications would do". > > I'd really like to stick to the standard GWT localisation > implementation for its very fast response.
Unfotunately, there's no reliable way to obtain the equivalent of the Accept-Languages request header in JavaScript (IE has navigator.userLanguage, Opera has navigator.language, but Firefox's navigator.language is the browser's locale, not the ones you set in the preferences). AFAICT, you should be able to override the property-provider for locale in your module's *.gwt.xml to use those properties if you like, but you'd better do content-negotiation on the server-side to return a different <meta>, or eventually redirect to the ?locale=, depending on the Accept-Languages request header (when there's no ?locale=XX already). --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---
