[seam-commits] Seam SVN: r9059 - branches/community/Seam_2_0/doc/Seam_Reference_Guide/en-US.

seam-commits at lists.jboss.org seam-commits at lists.jboss.org
Sat Sep 20 23:37:10 EDT 2008


Author: dan.j.allen
Date: 2008-09-20 23:37:10 -0400 (Sat, 20 Sep 2008)
New Revision: 9059

Modified:
   branches/community/Seam_2_0/doc/Seam_Reference_Guide/en-US/I18n.xml
Log:
Document the new <locale-config> element.


Modified: branches/community/Seam_2_0/doc/Seam_Reference_Guide/en-US/I18n.xml
===================================================================
--- branches/community/Seam_2_0/doc/Seam_Reference_Guide/en-US/I18n.xml	2008-09-21 03:36:42 UTC (rev 9058)
+++ branches/community/Seam_2_0/doc/Seam_Reference_Guide/en-US/I18n.xml	2008-09-21 03:37:10 UTC (rev 9059)
@@ -178,13 +178,34 @@
     <programlisting role="XHTML">&lt;h:selectOneMenu value="#{localeSelector.localeString}"&gt;
     &lt;f:selectItems value="#{localeSelector.supportedLocales}"/&gt;
 &lt;/h:selectOneMenu&gt;
-&lt;h:commandButton action="#{localeSelector.select}" value="#{messages['ChangeLanguage']}"/&gt;</programlisting>
+&lt;h:commandButton action="#{localeSelector.select}"
+    value="#{messages['ChangeLanguage']}"/&gt;</programlisting>
 
-    <para>When this use selects an item from the drop-down, and clicks the
-    button, the Seam and JSF locales will be overridden for the rest of the
+    <para>When 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.</para>
   </section>
 
+    <para>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 <literal>&lt;locale-config&gt;</literal>
+    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
+    <literal>org.jboss.seam.international.localeConfig</literal>. To use it,
+    you first declare an XML namespace for Seam's international package and
+    bind it to the i18n prefix. You then define the default locale and
+    supported locales as follows:</para>
+
+    <programlisting role="XML">&lt;international:locale-config default-locale="fr_CA"
+    supported-locales="en fr_CA fr_FR"/&gt;</programlisting>
+
+    <para>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.</para>
+
   <section>
     <title>Labels<anchor id="labels" /></title>
 
@@ -395,4 +416,4 @@
 
 &lt;international:locale-selector cookie-enabled="true"/&gt;</programlisting>
   </section>
-</chapter>
\ No newline at end of file
+</chapter>




More information about the seam-commits mailing list