Reputation: 1526
I have a gwt portlet with (for now) localization in English (default) and Dutch.
If I put ?locale=nl& in the address bar, I get nice Dutch texts. However, if I put <meta name="gwt:property" content="locale=nl" >
in the head of my html file, without any reference to locale in the address bar, I get the English texts. When I look into the rendered html source, I can see the <meta>
tag. According to the documentation it should give Dutch texts.
Does anybody have a suggestion about where I should look to fix this?
Upvotes: 0
Views: 349
Reputation: 39
Remember to include your meta tag in the head but BEFORE the js script containing you GWT module code is called.
Upvotes: 0
Reputation: 1526
I found it, I put my meta tag at the end of my part, so it was after the tag. I assumed the head was loaded completely before anything was done. Stupid me.
Upvotes: 0
Reputation: 2004
You could set fallback property value for locale in your module's .gwt.xml
which will be used as default
<set-property-fallback name="locale" value="nl" />
Then if you need to change localization (e.g. to English) set correct locale
URL parameter when loading portlet.
Also remember to set these properties in you module's .gwt.xml
<extend-property name="locale" values="nl" />
<extend-property name="locale" values="en" />
Upvotes: 1