I try to get all date/time format pattern in GWT, using DateTimeFormat.PredefinedFormat to get all pattern of the current locale. but how can i get all pattern for an other locale.

link|edit|flag

67% accept rate

1 Answer

I don't think you can do this. While building your application the GWT-Compiler creates multiple version of your application for the different locales. One specific version is then loaded by the browser, thus the other locale are not available at runtime. Read up on Deferred Binding if you want to know more: http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsDeferred.html

However there is an option to force a certain locale. This can be useful if you only support one locale, or it can be used for testing purposes. Add the following lines to your module XML file:

<inherits name="com.google.gwt.i18n.I18N"/>
<extend-property name="locale" values="en_US"/>
<set-property name="locale" value="en_US"/>
link|flag

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.