Hi Thomas - Thanks for the info. That sounds like it would work great if I had control over the host page. Unfortunately what I'm trying to do is make an embeddable widget, so I will not actually have any control over the host page. I've managed to dynamically insert CSS into the page, so I don't actually need the nocache.js file to do any of the CSS for me.
I would need to load the js dependencies though... have you ever done this manually? Any idea where docs might be? Is this even possible? -Andrew On Thu, Sep 3, 2009 at 12:26 AM, Thomas Broyer <[email protected]> wrote: > > > > On 2 sep, 23:50, mayop100 <[email protected]> wrote: > > Hey Guys - > > > > There's a section on this page: > http://code.google.com/webtoolkit/tutorials/1.6/i18n.html > > > > That suggests that there's an easy way to set the user's locale by > > parsing the Accept-Language header in the user's request. I want to > > have my GWT app always display the locale specified in the client's > > Accept-Language header - not the locale specified in the host page. I > > think I should be able to write a servlet to do this... and it sounds > > like this is possible based on that page, but I don't know enough > > about the bootstrap process to actually make this work. Has anyone > > else done this? > > To make it simple, we're using Apache's MultiViews with several copies > (not copies actually, as we have some "static HTML" that needs to be > translated): index.html.fr, index.html.en, etc. > And each page "loads" the appropriate locale using a <meta > name="gwt:property" content="locale=fr"> > (see > http://code.google.com/webtoolkit/doc/1.6/DevGuideI18nAndA11y.html#DevGuideSpecifyingLocale > ) > > but you could achieve the same using some servlet or JSP as your host > page, and generating the appropriate <meta>; there's something about > it in the GWT Incubator IIRC: > http://code.google.com/p/google-web-toolkit-incubator > > > A more general question is - is there a way I could write a servlet > > that pulls the client's browser type and locale from the request > > headers and returns the appropriate GWT permutation? This would let me > > skip the entire <Proj>.nocache.js bootstrap process and speed up > > initialization. I feel like this shouldn't be too hard, but I don't > > really know what setup goes on in the nocache.js bootstrap file. Has > > anyone done this before? Can this be done? or is there essential setup > > that occurs in the bootstrap file? > > the *.nocache.js also loads the stylesheet and javascript > dependencies, so it's a bit more than just selecting the appropriate > permutation. > Also, although you could determine the "browser type" on the server > side, you would have to make a choice when it comes to IE8, as it > could use either the ie6 or ie8 permutation depending on the > "documentMode". > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
