You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by bu...@apache.org on 2014/02/18 02:21:14 UTC

svn commit: r898333 - in /websites/production/tapestry/content: cache/main.pageCache localization.html wiki-status.html

Author: buildbot
Date: Tue Feb 18 01:21:14 2014
New Revision: 898333

Log:
Production update by buildbot for tapestry

Removed:
    websites/production/tapestry/content/wiki-status.html
Modified:
    websites/production/tapestry/content/cache/main.pageCache
    websites/production/tapestry/content/localization.html

Modified: websites/production/tapestry/content/cache/main.pageCache
==============================================================================
Binary files - no diff available.

Modified: websites/production/tapestry/content/localization.html
==============================================================================
--- websites/production/tapestry/content/localization.html (original)
+++ websites/production/tapestry/content/localization.html Tue Feb 18 01:21:14 2014
@@ -69,16 +69,14 @@
   </div>
 
 <div id="content">
-<div id="ConfluenceContent"><h1 id="Localization-Localization">Localization</h1>
-
-<div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
+<div id="ConfluenceContent"><h1 id="Localization-Localization">Localization</h1><div class="navmenu" style="float:right; background:#eee; margin:3px; padding:3px">
 <h3>Related Articles</h3>
 <ul class="content-by-label"><li>
             <div>
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="localization.html">Localization</a>
+                            <a shape="rect" href="component-classes.html">Component Classes</a>
                     
                 
                             </div>
@@ -87,7 +85,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="component-classes.html">Component Classes</a>
+                            <a shape="rect" href="templating-and-markup-faq.html">Templating and Markup FAQ</a>
                     
                 
                             </div>
@@ -96,7 +94,7 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="templating-and-markup-faq.html">Templating and Markup FAQ</a>
+                            <a shape="rect" href="component-parameters.html">Component Parameters</a>
                     
                 
                             </div>
@@ -105,42 +103,12 @@
                     <span class="icon icon-page" title="Page">Page:</span>            </div>
 
             <div class="details">
-                            <a shape="rect" href="component-parameters.html">Component Parameters</a>
+                            <a shape="rect" href="localization.html">Localization</a>
                     
                 
                             </div>
         </li></ul>
-</div> 
-
-<p><strong>Localization</strong> (aka L10n) is all about getting the right text to the user, in the right language.</p>
-
-<p>Localization support is well integrated into Tapestry. Tapestry allows you to easily separate the text you present to your users from the rest of your application ... pull it out of your Java code and even out of your component templates. You can then translate your messages into other languages and let Tapestry put everything together.</p>
-
-<h2 id="Localization-ComponentMessageCatalogs">Component Message Catalogs</h2>
-
-<p>Each component class may have a component message catalog. A component message catalog is a set of files with the extension ".properties". These property files are the same format used by java.util.ResourceBundle, just lines of <code>key=value</code>. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.</p>
-
-<p>So for a class named <code>org.example.myapp.pages.MyPage</code>, you would have a main properties file as <code>org/example/myapp/pages/MyPage.properties</code>.</p>
-
-<p>If you have a translations of these values, you provide additional properties file, adding an <a shape="rect" class="external-link" href="http://www.loc.gov/standards/iso639-2/englangn.html" >ISO language code</a> before the extension. Thus, if you have a French translation, you could create a file <code>MyPage_fr.properties</code>.</p>
-
-<p>Any values in the more language specific file will <em>override</em> values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create <code>MyPage_fr_FR.properties</code> (that's a language code plus a country code, and you can even go further and add variants ... but its unlikely that you'll ever need to go beyond just language codes in practice).</p>
-
-<p>The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.</p>
-
-<h3 id="Localization-ComponentMessageCatalogInheritance">Component Message Catalog Inheritance</h3>
-
-<p>If a component class is a subclass of another component class, then it inherits that base class' message catalog. Its own message catalog extends and overrides the values inherited from the base class.</p>
-
-<p>In this way, you could have a base component class that contained common messages, and extend or override those messages in subclasses (just as you would extend or override the methods of the base component class). This, of course, works for as many levels of inheritance as you care to support.</p>
-
-<h2 id="Localization-Application-wideMessageCatalog">Application-wide Message Catalog</h2>
-
-<p>If the file <code>WEB-INF/</code><em>AppName</em><code>.properties</code> exists in the context, it will be used as an application-wide message catalog. The <em>AppName</em> is derived from the name of the filter inside the web.xml file; this is most often just "app", thus <code>WEB-INF/app.properties</code>. The search for the file is case sensitive. The properties files may be localized.</p>
-
-<p>Individual pages and components can override the values defined in the message catalog.</p>
-
-<div class="navmenu" style="float:right; width:45%; background:white; margin:3px; padding:3px">
+</div><p><strong>Localization</strong> (aka L10n) is all about getting the right text to the user, in the right language.</p><p>Localization support is well integrated into Tapestry. Tapestry allows you to easily separate the text you present to your users from the rest of your application ... pull it out of your Java code and even out of your component templates. You can then translate your messages into other languages and let Tapestry put everything together.</p><h2 id="Localization-ComponentMessageCatalogs">Component Message Catalogs</h2><p>Each component class may have a component message catalog. A component message catalog is a set of files with the extension ".properties". These property files are the same format used by java.util.ResourceBundle, just lines of <code>key=value</code>. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.</p><p>So for a class named <code>org.example.myapp.pages.MyPage</code>, you wo
 uld have a main properties file as <code>org/example/myapp/pages/MyPage.properties</code>.</p><p>If you have a translations of these values, you provide additional properties file, adding an <a shape="rect" class="external-link" href="http://www.loc.gov/standards/iso639-2/englangn.html" >ISO language code</a> before the extension. Thus, if you have a French translation, you could create a file <code>MyPage_fr.properties</code>.</p><p>Any values in the more language specific file will <em>override</em> values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create <code>MyPage_fr_FR.properties</code> (that's a language code plus a country code, and you can even go further and add variants ... but its unlikely that you'll ever need to go beyond just language codes in practice).</p><p>The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.</
 p><h3 id="Localization-ComponentMessageCatalogInheritance">Component Message Catalog Inheritance</h3><p>If a component class is a subclass of another component class, then it inherits that base class' message catalog. Its own message catalog extends and overrides the values inherited from the base class.</p><p>In this way, you could have a base component class that contained common messages, and extend or override those messages in subclasses (just as you would extend or override the methods of the base component class). This, of course, works for as many levels of inheritance as you care to support.</p><h2 id="Localization-Application-wideMessageCatalog">Application-wide Message Catalog</h2><p>If the file <code>WEB-INF/</code><em>AppName</em><code>.properties</code> exists in the context, it will be used as an application-wide message catalog. The <em>AppName</em> is derived from the name of the filter inside the web.xml file; this is most often just "app", thus <code>WEB-INF/app.p
 roperties</code>. The search for the file is case sensitive. The properties files may be localized.</p><p>Individual pages and components can override the values defined in the message catalog.</p><div class="navmenu" style="float:right; width:45%; background:white; margin:3px; padding:3px">
     <div class="aui-message warning shadowed information-macro">
                     <p class="title">Avoid BOMs</p>
                             <span class="aui-icon icon-warning">Icon</span>
@@ -149,76 +117,28 @@
 <p>Make sure that your properties files don't contain <a shape="rect" class="external-link" href="http://en.wikipedia.org/wiki/Byte_order_mark" >byte order marks (BOM)</a>, because Java &#8211; and thus Tapestry &#8211; doesn't support BOM in properties files (see <a shape="rect" class="external-link" href="http://bugs.sun.com/view_bug.do?bug_id=4508058" >http://bugs.sun.com/view_bug.do?bug_id=4508058</a>). Some editors write them out when saving a file in UTF-8, so watch out.</p>
                     </div>
     </div>
-</div>
-
-<h2 id="Localization-PropertiesFileCharset">Properties File Charset</h2>
-
-<p>Tapestry uses the <code>UTF-8</code> character set (charset) when reading the properties files in a message catalog. This means that you don't have to use the Java <code>native2ascii</code> tool.</p>
-
-<h2 id="Localization-LocalizedComponentTemplates">Localized Component Templates</h2>
-
-<p>The same lookup mechanism applies to component templates. Tapestry will search for a localized version of each component template and use the closest match. Thus you could have <code>MyPage_fr.html</code> for French users, and <code>MyPage.html</code> for all other users.</p>
-
-<h2 id="Localization-AccessingLocalizedMessages">Accessing Localized Messages</h2>
-
-<p>The above discusses what files to create and where to store them, but doesn't address how to make use of that information.</p>
-
-<p>Messages can be accessed in one of two ways:</p>
-
-<ul><li>Using the "message:" <a shape="rect" href="component-parameters.html">binding expression</a> in a component template</li><li>By injecting the component's Messages object<br clear="none">
-In the first case, you may use the message: binding prefix with component parameters, or with template expansions:</li></ul>
-
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-&lt;t:layout title=&quot;message:page-title&quot;&gt;
+</div><h2 id="Localization-PropertiesFileCharset">Properties File Charset</h2><p>Tapestry uses the <code>UTF-8</code> character set (charset) when reading the properties files in a message catalog. This means that you don't have to use the Java <code>native2ascii</code> tool.</p><h2 id="Localization-LocalizedComponentTemplates">Localized Component Templates</h2><p>The same lookup mechanism applies to component templates. Tapestry will search for a localized version of each component template and use the closest match. Thus you could have <code>MyPage_fr.html</code> for French users, and <code>MyPage.html</code> for all other users.</p><h2 id="Localization-AccessingLocalizedMessages">Accessing Localized Messages</h2><p>The above discusses what files to create and where to store them, but doesn't address how to make use of that information.</p><p>Messages can be accessed in one of two ways:</p><ul><li>Using the "message:" <a shape="rect" href="component-parameters.html">binding expres
 sion</a> in a component template</li><li>By injecting the component's Messages object<br clear="none"> In the first case, you may use the message: binding prefix with component parameters, or with template expansions:</li></ul><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[&lt;t:layout title=&quot;message:page-title&quot;&gt;
 
   ${message:greeting}, ${user.name}!
   
   . . .
 &lt;/t:layout&gt;
 ]]></script>
-</div></div>
-
-<p>Here, the <code>page-title</code> message is extracted from the catalog and passed to the Border component's title parameter.</p>
-
-<p>In addition, the <code>greeting</code> message is extracted and written into the response as part of the template.</p>
-
-<p>As usual, "prop:" is the default binding prefix, thus <code>user.name</code> is a property path, not a message key.</p>
-
-<p>You would extend this with a set of properties files:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-page-title=Your Account
+</div></div><p>Here, the <code>page-title</code> message is extracted from the catalog and passed to the Border component's title parameter.</p><p>In addition, the <code>greeting</code> message is extracted and written into the response as part of the template.</p><p>As usual, "prop:" is the default binding prefix, thus <code>user.name</code> is a property path, not a message key.</p><p>You would extend this with a set of properties files:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[page-title=Your Account
 greeting=Welcome back
 ]]></script>
-</div></div>
-
-<p>Or, perhaps, a French version:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-page-title=Votre Compte
+</div></div><p>Or, perhaps, a French version:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[page-title=Votre Compte
 greeting=Bienvenue en arriere
 ]]></script>
-</div></div>
-
-<p>Programatically, you may inject your component message catalog into your class, as an instance of the Messages interface:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-  @Inject
+</div></div><p>Programatically, you may inject your component message catalog into your class, as an instance of the Messages interface:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  @Inject
   private Messages messages;
 ]]></script>
-</div></div>
-
-<p>You could then <code>get()</code> messages, or <code>format()</code> them:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-
-  public String getCartSummary()     
+</div></div><p>You could then <code>get()</code> messages, or <code>format()</code> them:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[  public String getCartSummary()     
   {
     if (items.isEmpty())
       return messages.get(&quot;no-items&quot;);
@@ -226,44 +146,12 @@ greeting=Bienvenue en arriere
     return messages.format(&quot;item-summary&quot;, _items.size());
   }
 ]]></script>
-</div></div>
-
-<p>The format() option works using a <code>java.util.Formatter</code>, with all the printf-style loveliness you've come to expect:</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-no-items=Your shopping cart is empty.     
+</div></div><p>The format() option works using a <code>java.util.Formatter</code>, with all the printf-style loveliness you've come to expect:</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[no-items=Your shopping cart is empty.     
 item-summary=You have %d items in your cart.
 ]]></script>
-</div></div>
-
-<p>As easy as conditionals are to use inside a Tapestry template, sometimes it's even easier to do it in Java code.</p>
-
-<h2 id="Localization-MissingKeys">Missing Keys</h2>
-
-<p>If you reference a key that is not in the message catalog, Tapestry does not throw an exception (because that would make initially developing an application very frustrating). When a key can not be located, a "placeholder" message is generated, such as "[[missing key: key-not-found]]".</p>
-
-<h2 id="Localization-Reloading">Reloading</h2>
-
-<p>If you change a property file in a message catalog, you'll see the change immediately, just as with component classes and component templates (provided you're not running in <a shape="rect" href="configuration.html#Configuration-tapestry.production-mode">production mode</a>).</p>
-
-<h2 id="Localization-AssetLocalization">Asset Localization</h2>
-
-<p>When <a shape="rect" href="injection.html">injecting assets</a>, the injected asset will be localized as well. A search for the closest match for the active locale is made, and the final Asset will reflect that.</p>
-
-<h2 id="Localization-LocaleSelection">Locale Selection</h2>
-
-<p>The locale for each request is determined from the HTTP request headers. The request locale reflects the environment of the web browser and possibly even the keyboard selection of the user on the client. It can be highly specific, for example, identifying British English (as en_GB) vs. American English (en).</p>
-
-<p>Tapestry "narrows" the raw request locale, as specified in the request, to a known quantity. It uses the <a shape="rect" href="configuration.html">configuration symbol</a> <code>tapestry.supported-locales</code> to choose the effective locale for each request. This value is a comma-separated list of locale names. Tapestry searches the list for the best match for the request locale; for example, a request locale of "fr_FR" would match "fr" but not "de". If no match is found, then the first locale name in the list is used as the effective locale (that is, the first locale is used as the default for non-matching requests). Thus a site that primarily caters to French speakers would want to list "fr" as the first locale in the list.</p>
-
-<h2 id="Localization-ChangingtheLocale">Changing the Locale</h2>
-
-<p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html">PersistentLocale service</a> can be used to programmatically override the locale. Note: You should be careful to only set the persistent locale to a supported locale.</p>
-
-<div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Toggle between English and German</b></div><div class="codeContent panelContent pdl">
-<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[
-@Inject 
+</div></div><p>As easy as conditionals are to use inside a Tapestry template, sometimes it's even easier to do it in Java code.</p><h2 id="Localization-MissingKeys">Missing Keys</h2><p>If you reference a key that is not in the message catalog, Tapestry does not throw an exception (because that would make initially developing an application very frustrating). When a key can not be located, a "placeholder" message is generated, such as "[[missing key: key-not-found]]".</p><h2 id="Localization-Reloading">Reloading</h2><p>If you change a property file in a message catalog, you'll see the change immediately, just as with component classes and component templates (provided you're not running in <a shape="rect" href="configuration.html#Configuration-tapestry.production-mode">production mode</a>).</p><h2 id="Localization-AssetLocalization">Asset Localization</h2><p>When <a shape="rect" href="injection.html">injecting assets</a>, the injected asset will be localized as well. A search for the
  closest match for the active locale is made, and the final Asset will reflect that.</p><h2 id="Localization-LocaleSelection">Locale Selection</h2><p>The locale for each request is determined from the HTTP request headers. The request locale reflects the environment of the web browser and possibly even the keyboard selection of the user on the client. It can be highly specific, for example, identifying British English (as en_GB) vs. American English (en).</p><p>Tapestry "narrows" the raw request locale, as specified in the request, to a known quantity. It uses the <a shape="rect" href="configuration.html">configuration symbol</a> <code>tapestry.supported-locales</code> to choose the effective locale for each request. This value is a comma-separated list of locale names. Tapestry searches the list for the best match for the request locale; for example, a request locale of "fr_FR" would match "fr" but not "de". If no match is found, then the first locale name in the list is used as th
 e effective locale (that is, the first locale is used as the default for non-matching requests). Thus a site that primarily caters to French speakers would want to list "fr" as the first locale in the list.</p><h2 id="Localization-ChangingtheLocale">Changing the Locale</h2><p>The <a shape="rect" class="external-link" href="http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html">PersistentLocale service</a> can be used to programmatically override the locale. Note: You should be careful to only set the persistent locale to a supported locale.</p><div class="code panel pdl" style="border-width: 1px;"><div class="codeHeader panelHeader pdl" style="border-bottom-width: 1px;"><b>Toggle between English and German</b></div><div class="codeContent panelContent pdl">
+<script class="theme: Default; brush: java; gutter: false" type="syntaxhighlighter"><![CDATA[@Inject 
 private PersistentLocale persistentLocale;
 
 void onActionFromLocaleToggle() {
@@ -278,48 +166,13 @@ public String getDisplayLanguage() {
     return persistentLocale.get().getDisplayLanguage();
 }
 ]]></script>
-</div></div>
-
-<p>Once a persistent locale is set, you will see the locale name as the first virtual folder in page render and component event requests URLs. In this way, a persistent locale will, in fact, persist from request to request, or in a user's bookmarks.</p>
-
-<p>You will see the new locale take effect on the next request. If it is changed in a component event request (which is typical), the new locale will be used in the subsequent page render request.</p>
-
-<p>Note that the locale for a page is fixed (it can't change once the page instance is created). In addition, a page may only be attached to a request once. In other words, if code in your page changes the persistent locale, you won't see a change to the page's locale (or localized messages) <em>in that request</em>.</p>
-
-<h2 id="Localization-Built-inLocales">Built-in Locales</h2>
-
-<p>While your application can support any locale (and thus any language) that you want, Tapestry provides only a limited set of translations for its own built-in messages. As of Tapestry 5.3, the following locales have translations provided:</p>
-
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> en (English)    </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> es (Spanish)   </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> ja (Japanese)    </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> pt (Portuguese) </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> zh (Chinese)   </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> bg (Bulgarian)  </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> fi (Finnish)   </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> mk (Macedonian)  </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> ru (Russian)    </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> da (Danish)     </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> fr (French)   
  </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> nl (Dutch)       </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> sr (Serbian)    </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> de (German)     </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> hr (Croatian)  </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> no (Norwegian)   </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> sv (Swedish)    </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> el (Greek)      </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> it (Italian)   </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> pl (Polish)      </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p> vi (Vietnamese) </p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#
 160;</p></td></tr></tbody></table></div>
-
-
-<h3 id="Localization-ProvidingtranslationsforTapestrybuilt-inmessages">Providing translations for Tapestry built-in messages</h3>
-
-<p>Fortunately, Tapestry uses all the same mechanisms for its own locale support as it provides for your application. So, to support other locales, just translate the built-in message catalog (property) files yourself:</p>
-
-<p></p><p>
-<style type="text/css">table.sectionMacro { width: auto; }</style>
-</p><p></p>
-
-<div class="sectionColumnWrapper"><div class="sectionMacro">
-<div class="sectionMacroRow"><div class="columnMacro">
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Tapestry 5.4 and later </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=tree;f=tapestry-core/src/main/resources/org/apache/tapestry5">core.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=tree;f=tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha">tapestry-kaptcha.properties</a> </p></td></tr></tbody></table></div>
-</div>
-<div class="columnMacro">
-<div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p> Tapestry 5.3.x </p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm.properties?view=markup">BeanEditForm.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties?view=markup">DateField.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/com
 ponents/Errors.properties?view=markup">Errors.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns.properties?view=markup">GridColumns.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridPager.properties?view=markup">GridPager.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Palette.properties?view=markup">Palette.properties</a> </p></td></t
 r><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages.properties?view=markup">ValidationMessages.properties</a> </p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p> <a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties?view=markup">tapestry-kaptcha.properties</a> </p></td></tr></tbody></table></div>
-</div></div></div></div>
-
-<p>To have Tapestry use these new files, just put them in the corresponding package-named directory within your own app (for example, src/main/resources/org/apache/tapestry5/core.properties).</p>
-
-<p>Finally, please open a new feature request <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/TAP5">here</a> and attach the translated files so that they can be included in the next release of Tapestry.</p>
-
-    <div class="aui-message hint shadowed information-macro">
+</div></div><p>Once a persistent locale is set, you will see the locale name as the first virtual folder in page render and component event requests URLs. In this way, a persistent locale will, in fact, persist from request to request, or in a user's bookmarks.</p><p>You will see the new locale take effect on the next request. If it is changed in a component event request (which is typical), the new locale will be used in the subsequent page render request.</p><p>Note that the locale for a page is fixed (it can't change once the page instance is created). In addition, a page may only be attached to a request once. In other words, if code in your page changes the persistent locale, you won't see a change to the page's locale (or localized messages) <em>in that request</em>.</p><h2 id="Localization-Built-inLocales">Built-in Locales</h2><p>While your application can support any locale (and thus any language) that you want, Tapestry provides only a limited set of translations for its ow
 n built-in messages. As of Tapestry 5.3, the following locales have translations provided:</p><div class="table-wrap"><table class="confluenceTable"><tbody><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>en (English)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>el (Greek)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>it (Italian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>pl (Polish)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>vi (Vietnamese)</span></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>bg (Bulgarian)</p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>es (Spanish)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>ja (Japanese)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>pt (Portuguese)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>zh (Chinese)</sp
 an></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p>cs (Czech)<sup>1</sup></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>fi (Finnish)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>mk (Macedonian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>ru (Russian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>da (Danish)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>fr (French)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>nl (Dutch)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>sr (Serbian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><span>de (German)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><sp
 an>hr (Croatian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>no (Norwegian)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p><span>sv (Swedish)</span></p></td><td colspan="1" rowspan="1" class="confluenceTd"><p>&#160;</p></td></tr></tbody></table></div><p><sup>1&#160;</sup><span style="line-height: 1.4285715;">as of Tapestry 5.3.8</span></p><h3 id="Localization-ProvidingtranslationsforTapestrybuilt-inmessages">Providing translations for Tapestry built-in messages</h3><p>Fortunately, Tapestry uses all the same mechanisms for its own locale support as it provides for your application. So, to support other locales, just translate the built-in message catalog (property) files yourself:</p><p>&#160;</p><style type="text/css">table.sectionMacro { width: auto; }</style>
+<div class="sectionColumnWrapper"><div class="sectionMacro"><div class="sectionMacroRow"><div class="columnMacro"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry 5.4 and later</p></th></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=tree;f=tapestry-core/src/main/resources/org/apache/tapestry5">core.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=tree;f=tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha">tapestry-kaptcha.properties</a></p></td></tr></tbody></table></div></div><div class="columnMacro"><div class="table-wrap"><table class="confluenceTable"><tbody><tr><th colspan="1" rowspan="1" class="confluenceTh"><p>Tapestry 5.3.x</p></th></tr
 ><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm.properties?view=markup">BeanEditForm.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties?view=markup">DateField.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors.properties?view=markup">Errors.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class=
 "external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns.properties?view=markup">GridColumns.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridPager.properties?view=markup">GridPager.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Palette.properties?view=markup">Palette.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/
 5.3/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages.properties?view=markup">ValidationMessages.properties</a></p></td></tr><tr><td colspan="1" rowspan="1" class="confluenceTd"><p><a shape="rect" class="external-link" href="http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties?view=markup">tapestry-kaptcha.properties</a></p></td></tr></tbody></table></div></div></div></div></div><p>To have Tapestry use these new files, just put them in the corresponding package-named directory within your own app (for example, src/main/resources/org/apache/tapestry5/core.properties).</p><p>Finally, please open a new feature request <a shape="rect" class="external-link" href="https://issues.apache.org/jira/browse/TAP5">here</a> and attach the translated files so that they can be included in the next release of Tapestry.</p>    <div class="aui-message hint shadowed infor
 mation-macro">
                             <span class="aui-icon icon-hint">Icon</span>
                 <div class="message-content">
                             <p>Please note that a patch is always preferred over an archive of properties files.</p>
                     </div>
-    </div>
- </div>
+    </div></div>
 </div>
 
 <div class="clearer"></div>