views:

1324

answers:

3

Our application should be fixed to use eb-GB locale. For now I've added:

<extend-property name="locale" values="en_GB"/>

But this means that GWT builds premutations for both. How to setup GWT to eb-GB by default? Or how to remove default from compilation?

A: 

See this.

You need to specify the locale in the host page like so...

<meta name="gwt:property" content="locale=x_Y">

You could also write your own property provider.

prometheus
This will not replace `default` locale. This is about to setup what locale to use. What I need is `default` locale to bahaive as `en_GB`.
Mike Chaliy
If you've specified a locale (as you've shown above), shouldn't it replace the default. Here is what is said about the Default Locale... "The com.google.gwt.i18n.I18N module defines only one locale by default, called default. This default locale is used when the locale client property goes unspecified in deployment. The default locale is used internally as a last-resort match between a Localizable interface and a localized resource or class."
prometheus
We use exaclty one locale - `default`, but we want it to be en-GB rather en-US. This is why I've asked how to configure default locale.
Mike Chaliy
+1  A: 

You can set the default via the annotation: @DefaultLocale("en_GB") on the interfaces extending the i18 interfaces, e.g. com.google.gwt.i18.client.Messages.

For example:

@DefaultLocale("en_GB")
public interface MyMessages extends com.google.gwt.i18.client.Messages {
  ...

I'm not sure if this actual solves your problem, but it seems the way to set the default. See also http://code.google.com/p/google-web-toolkit/wiki/I18nAnnotations

Hilbrand
This looks like what you are really looking for.
prometheus
I mostly need this for built-in stuff. Like date time and number formates. So thank you for pointing this out, but this does not solve my problem. Anyway thanks for your time.
Mike Chaliy
+2  A: 

How about:

<set-property name="locale" value="en_GB" />
David Nouls
I guess you will need to combine this with answers from above.
David Nouls
This works! I've had this idea. But seems typed something icorrectly.
Mike Chaliy