Friday, January 31, 2020

Re: i18n Failing

Hi,

For EN and DE I have the following

<!-- Locale -->
<inherits name="com.google.gwt.i18n.I18N" />

<!-- German language, independent of country -->
<extend-property name="locale" values="de" />
<extend-property name='locale' values='de_DE' />
<!-- English language, independent of country -->
<extend-property name="locale" values="en" />
<set-property-fallback name='locale' value='en' />
<set-property name='locale' value='de_DE' />

extend-property - add support for a specific locale, set-property, in the end, sets the "default" locale. 

Best,
Stas

On Friday, January 31, 2020 at 10:36:48 AM UTC+1, Andrew Buck wrote:
I am trying to add a second locale to my GWT app, but I'm unable to make it work.

Up until now, I've had:
<extend-property name="locale" values="en" />
<set-property name="locale" value="en" />
<set-property-fallback name="locale" value="en"/>

And now if I change it to:
<extend-property name="locale" values="en,es" />
<set-property name="locale" value="en" />
<set-property-fallback name="locale" value="en"/>

And add a tag in the page header:
<meta name='gwt:property' content='locale=es'/>

I still always see the page in English.

If I instead do:
<extend-property name="locale" values="en,es" />
<set-property name="locale" value="es" />
<set-property-fallback name="locale" value="en"/>

Then I always see the page in Spanish.

The <set-property...> tag is not shown in the GWT documentation, but if I remove it, then I get a compile error: 
"Failed to resolve '[package-name].i18n.FixedStrings' via deferred binding"

--
You received this message because you are subscribed to the Google Groups "GWT Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-web-toolkit/4c8d0d55-723d-45e6-92fb-927e511637ce%40googlegroups.com.

No comments:

Post a Comment