here's what we do: very simple java script (in the header section of the .html file) of course the accept-language approach is much better and I also consider implementing that approach: some day when I have some spare time :)
... <script type="text/javascript"> var lang="en"; if (navigator.language.indexOf("en") > -1) { lang="en"; } else if (navigator.language.indexOf("de") > -1) { lang="de"; } document.write("<meta name='gwt:property' content='locale="+lang +"'>"); </script> <script type="text/javascript" language="javascript" src="com.tfact.TFAct.nocache.js"></script> </head> On Nov 4, 8:29 pm, prody <[EMAIL PROTECTED]> wrote: > Thank you all for your reply. > I'm trying to use GWT incubator code. I could not find a working > example. > > The documentation says- > > // Per-request code for the host html page > String locale = > localeMatcher.findBestMatch(request.getHeader("Accept-language")); > // Store the selected locale in the host html page to be served, via > // <meta name='gwt:property' content='locale=<<locale>>'> > // Be sure to include a Vary: Accept-language header in the > response. > > Just by adding <meta name='gwt:property' content='locale=<<locale>>'> > into html host page and then setting locale ="es" on server side > doesn't seem to work. > > Has anyone been able to resolve this issue? Could you please provide a > working example(using jsp in host page or gwt incubator?? > > Thanks ! > > On Nov 4, 5:53 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > I think that jsp is the better way. Just rename gwt html file to a jsp > > file in which add some java code. And on client you should access the > > jsp file. > > > rashmi wrote: > > > Hi all, > > > I'm new to GWT and I'm trying to implement GWT static string > > > internationalization > > > I understand that in order to specify a locale at run time you need to > > > use meta tag or rewrite URL. > > > > If I add "locale=xx" in the meta tag or in the URL as below, I can see > > > the string internationalization working in my application. > > > <meta name="gwt:property" content="locale=de"> > > > or > > >http://www.example.org/myapp.html?locale=de > > > > But, I would like to dynamically generate the meta tag to set locale > > > at run time based on the client's browser locale. How to I change the > > > meta tag dynamically to use client's locale settings? Most browsers > > > send an Accept-Language header - is there any way in GWT to use that > > > information to dynamically generate the meta-tag? > > > > I would really appreciate any reply. > > > > Regards, > > > Rashmi- Hide quoted text - > > > - Show quoted text - --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group. To post to this group, send email to Google-Web-Toolkit@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---