Wednesday, August 20, 2014

Re: Generation of permutations

I think the "best practice" is to decide which locale is your "primary" locale and:
  • define it as the fallback locale, and
  • use non-suffixed properties file for that locale
and accept that a permutation for the "default" locale might be generated (should be the case as soon as you use locale-sensitive number or date formatting, if you only have messages then the "default" and "your primary" locale would possibly generate the same code and thus a single permutation).

But using <set-property name="locale" value="de,en" /> (i.e. your supported locales minus "default") should work I believe (John, who's the maintainer for the I18N stuff, said somewhere in the issue tracker that he wouldn't recommend it as it could break things in unpredictable ways, so I'd say if generating an extra permutation is really a problem for you, try removing the "default" locale and see if that works for you)

On Friday, August 15, 2014 11:40:00 AM UTC+2, Developer wrote:
After adding

<set-property name="locale" value="de_DE,en_US" />

I'm getting just two permutations - great!

But I still need the AppResources.properties file. Otherwise I'm still getting the above error message "No resource found for key...".

Even after adding

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

I still get that exception.

Only if I restrict my app to one locale by changing
<set-property name="locale" value="de_DE,en_US" />
to
<set-property name="locale" value="de_DE" />
it i compiled without the existance of AppResources.properties but I'm loosing the possibility to switch between de_DE and en_US then.

--
You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-web-toolkit+unsubscribe@googlegroups.com.
To post to this group, send email to google-web-toolkit@googlegroups.com.
Visit this group at http://groups.google.com/group/google-web-toolkit.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment