2

I want to localize my GWT project to more laguages so I added to my module.gwt.xml this section `

<inherits name="com.google.gwt.i18n.I18N" /> 
<extend-property name="locale" values="en" />
<extend-property name="locale" values="cs" />

I created all the properties files and interfaces but after loading module I get this exception.

        00:00:02,960 [WARN] Unable to get locale properties, using defaults
    com.google.gwt.core.ext.BadPropertyValueException: Property 'locale' cannot be set to unexpected value '<failed to compute>'

Any idea where can be the problem? Because when I have just one locale for example

<inherits name="com.google.gwt.i18n.I18N" /> 
<extend-property name="locale" values="en" />

it works fine. I tried to add to avoid generating permutations for default locale but this even doesn`t work

<set-property name="locale" value="en, cs"/>
2
  • Are your resource files properly named? E.g. TextResources_en.properties, TextResources_cs.properties, etc? Commented Feb 16, 2012 at 10:36
  • Yes they are named Lokalizace_cs.properties, Lokalizace_en.properties and interface is namen Lokalizace.java Commented Feb 16, 2012 at 12:22

4 Answers 4

2

Try

<extend-property name="locale" values="en, cs" />
Sign up to request clarification or add additional context in comments.

5 Comments

Excuese me, As Marcelo said did you try. I edited the answer maybe it helps you. And on new settings what error message do you get?
Yes I tried also your edited answer but I always get the same error message
I think there is a problem another part of your project because I tried your code and get the message you write. But correct the code as Marcelo and I said and error message disappear.
Hmm that`s strange I have no clue where the problem can be.
Yes I am editing true .gwt.xml because when I edit .gwt.xml way there are compiled only permutations for one language it works well
1

If the page loads without specifying a locale through the supported mechanisms (meta tag, url param, see http://code.google.com/webtoolkit/doc/latest/DevGuideI18nLocale.html#LocaleSpecifying for more details on how these are accomplished), it will try to fall back on a default. For that reason, you must specify a default locale to fall back on, or you get an error, as the app can't load without selecting a locale.

Set a default locale like this (from http://code.google.com/webtoolkit/doc/latest/DevGuideI18nLocale.html#LocaleDefault):

<set-property-fallback name="locale" value="en"/>

If your page will always load with a default, there is no need to provide a fallback. But for testing purposes, you may find it helpful to always use one.

Comments

0

Excuse me, As Marcelo said did you try below code.

<inherits name="com.google.gwt.i18n.I18N" /> 
<extend-property name="locale" values="en_US, cs_CZ" />

Could you try above code?

Source

You could find locale values here

Comments

0

I had a similar situation. I commented out locales in gwt.xml to speed up compilation process and that obviously made all locales other than English unavailable. Then when I decided to test more than one locale and uncommented locales in gwt.xml I got the same error as posted in the question (in dev mode). Only when I recompiled the project again with all locales available the error went away.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.