On 29 oct, 12:51, jagadesh <[EMAIL PROTECTED]> wrote: > Hi Guys , > > Iam Working On Gwt 1.5.3 . My Requirement is > Iam Using 2 languages one is English and other is Chines > [ Traditional] > > i have written 2 constants file for both. now how can i set the > language depending on the browser locale. > i.e if the site opens in china , the language should be chinese and > chinese constant file should be selected. > > how can i do this sort of thing . > > Can Anyone Sort Me out. a sample code would be more helpfull.
You should use content-negotiation on the server-side to serve a different HTML depending on the announced user preferences re. languages. The HTML files will be identical except for a <meta name="gwt:property" content="locale=zh"> vs. <meta name="gwt:property" content="locale=en"> See http://code.google.com/docreader/#p=google-web-toolkit-doc-1-5&t=DevGuideSpecifyingLocale If you use Apache, it's as easy as turning on "MultiViews" and name your files index.html.en and index.html.zh (replace "index" with whatever you want), or using a type-map file. See http://httpd.apache.org/docs/2.0/content-negotiation.html If you serve your HTML from a servlet container (e.g. Tomcat), there's some code in the GWT-Incubator project to do just that too (you'll have to build a Filter or a Servlet by yourself to serve your HTML though, it doesn't come out-of-the-box): http://code.google.com/docreader/#p=google-web-toolkit-incubator&t=ServerSideLocaleSelection --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
