dev@woodstock.java.net

Re: Localization on the fly

From: richard ratta <Richard.Ratta_at_Sun.COM>
Date: Tue, 02 Dec 2008 21:08:15 -0500

What version of woodstock are you using ?

The last I remember is that the locale IS determined based on browser
locale and
you should not have to do anything else to see this.

Now the gotcha...

Depending on which version of woodstock you are using you have to
make sure that the javascript theme also reflects the localizations you
are setting
in "messages_de.properties.".

In the later versions of woodstock, especially for components that have
widget renderers, the javascript theme must have all the localizations
that exist
in properties files. This is accomplished in the build of the "theme".

See

http://webdev2.sun.com/woodstock-theme-doc/index.html#toc

for more information on this topic.

-rick

mike.r.phillips wrote:

>Can woodstock localization be based on the users current browser language
>choice(request.getLocale())?
>
>After creating a sun/webui/jsf/suntheme/messages/messages_de.properties
>I can only get the correct localized strings and buttons used by the
>underlying components to be used if I add
>a JVM option "-Duser.language=de" to the app server, or if I use
>Locale.setDefault(choosenLocale) and then
>re-deploy my app.
>
>if I use <f:view locale="<%= request.getLocale() %>"> the bundles I create
>that are not part of
>underlying components are localized correctly and change for each user base
>on browser preference.
>
>Is there a way to tell components to reload the localized strings without
>bouncing app server?
>
>