
component named
locale). Under normal circumstances,
you won't need to do any special configuration to set the locale. Seam
just delegates to JSF to determine the active locale:
If there is a locale associated with the HTTP request (the
browser locale), and that locale is in the list of supported locales
from
faces-config.xml, use that locale for the rest
of the session.
Otherwise, if a default locale was specified in the
faces-config.xml, use that locale for the rest of
the session.
Otherwise, use the default locale of the server. the user selects an item from the drop-down, then clicks the command button, the Seam and JSF locales will be overridden for the rest of the session.
The brings us to the question of where the supported locales are
defined. Typically, you provide a list of locales for which you have
matching resource bundles in the
<locale-config>
element of the JSF configuration file (/META-INF/faces-config.xml). However,
you have learned to appreciate that Seam's component configuration
mechanism is more powerful than what is provided in Java EE. For that
reason, you can configure the supported locales, and the default locale of
the server, using the built-in component named
org.jboss.seam.international.localeConfig. To use it,
you first declare an XML namespace for Seam's international package in the
Seam component descriptor. You then define the default locale and supported
locales as follows:
<international:locale-config
Naturally, if you pronounce that you support a locale, you better provide a resource bundle to match it! Up next, you'll learn how to define the language-specific labels. xmlns=""
xmlns:ui=""
xmlns:h=""
xmlns: