[CONF] Apache Tapestry Localization

2014-06-01 Thread Bob Harner (Confluence)














  


Bob Harner edited the page:
 


Localization   




 Comment: Added Slovenian to the list of supported locales 


...




 en (English) 
  el (Greek)  
  it (Italian)  
  pl (Polish)  
  vi sv (VietnameseSwedish)  


 bg (Bulgarian) 
  es (Spanish)  
  ja (Japanese)  
  pt (Portuguese)  
  zh vi (ChineseVietnamese)  


 cs (Czech)1  
  fi (Finnish)  
  mk (Macedonian)  
  ru (Russian)  
  zh (Chinese)  


  da (Danish)  
  fr (French)  
  nl (Dutch)sr   
sl (SerbianSlovenian)2
  


  de (German)  
  hr (Croatian)  
  no (Norwegian)  
  sv sr (SwedishSerbian)  
  




 1as of Tapestry 5.3.8 
 2 as of Tapestry 5.4 
Providing translations for Tapestry built-in messages
...






   

[CONF] Apache Tapestry Localization

2013-01-24 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Added Polish to list of built-in locales


 Changes (6)
 




...
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:  
| en (English)| es (Spanish)   | ja (Japanese)| ru (Russian) pt (Portuguese) | zh (Chinese)   | 
| bg (Bulgarian)  | fi (Finnish)   | mk (Macedonian)  | sr (Serbian) ru (Russian)|| 
| da (Danish) | fr (French)| nl (Dutch)   | sv (Swedish) sr (Serbian)|| 
| de (German) | hr (Croatian)  | no (Norwegian)   | vi (Vietnamese) sv (Swedish)|| 
| el (Greek)  | it (Italian)   | pt (Portuguese)  | zh (Chinese)   
| el (Greek)  | it (Italian)   | pl (Polish)  | vi (Vietnamese) || 
 h3. Providing translations for Tapestry built-in messages 
...


Full Content

Localization


Related Articles


 Page:
 Templating and Markup FAQ





 Page:
 Component Classes





 Page:
 Component Parameters





 Page:
 Localization




 

Localization (aka L10n) is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Component Message Catalog Inheritance

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.

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.

Application-wide Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Avoid BOMsMake sure that your properties files don't contain byte order marks (BOM), because Java  and thus Tapestry  doesn't support BOM 

[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Added list of supported languages, and instructions on providing translations to Tapestry's built-in messages


 Changes (4)
 




...
h2. Changing the Locale  
The [PersistentLocale service|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html] can be used to programmatically override the locale for the current request. 
The [PersistentLocale service|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html] can be used to programmatically override the locale. Note: You should be careful to only set the persistent locale to a supported locale. 
 {code:java|title=Toggle between English and German} 
...
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 users bookmarks.  
You should be careful to only set the persistent locale to a supported locale.  
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.  Note that the locale for a page is fixed (it cant 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 wont see a change to the pages locale (or localized messages) _in that request_. 
 h2. Built-in Locales  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:  | en (English)| es (Spanish)   | ja (Japanese)| ru (Russian)  | bg (Bulgarian)  | fi (Finnish)   | mk (Macedonian)  | sr (Serbian)  | da (Danish) | fr (French)| nl (Dutch)   | sv (Swedish)  | de (German) | hr (Croatian)  | no (Norwegian)   | zh (Chinese)  | el (Greek)  | it (Italian)   | pt (Portuguese)  |   h3. Providing translations for Tapestry built-in messages  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:  {html} style type=text/csstable.sectionMacro { width: auto; }/style {html}  {section:width=auto} {column} || Tapestry 5.4 and later || | [core.properties|https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-core/src/main/resources/org/apache/tapestry5/core.properties;hb=HEAD] | | [tapestry-kaptcha.properties|https://git-wip-us.apache.org/repos/asf?p=tapestry-5.git;a=blob;f=tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties;hb=HEAD] | {column} {column} || Tapestry 5.3.x || | [BeanEditForm.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/BeanEditForm.properties?view=markup] | | [DateField.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/DateField.properties?view=markup] | | [Errors.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Errors.properties?view=markup] | | [GridColumns.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridColumns.properties?view=markup] | | [GridPager.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/GridPager.properties?view=markup] | | [Palette.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/Palette.properties?view=markup] | | [ValidationMessages.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-core/src/main/resources/org/apache/tapestry5/internal/ValidationMessages.properties?view=markup] | | [tapestry-kaptcha.properties|http://svn.apache.org/viewvc/tapestry/tapestry5/branches/5.3/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties?view=markup] | {column} {section}  To have Tapestry use these new files, just put them in the corresponding package-named directory within your own app (for 

[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


 Changes (1)
 




h1. Localization  
{float:right|background="" {contentbylabel:title=Related Articles|showLabels=false|showSpace=false|space=@self|labels=component-templates,localization} {float}   
Localization is all about getting the right text to the user, in the right language.  
...


Full Content

Localization


Related Articles


 Page:
 Templating and Markup FAQ





 Page:
 Component Classes





 Page:
 Component Parameters




 

Localization is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Properties File Charset

Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. Make sure that your properties files don't contain byte order marks (BOM) as Java - and thus Tapestry - doesn't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Message Catalog Inheritance

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.

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.

Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Localized Component Templates

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 MyPage_fr.html for French users, and MyPage.html for all other users.

Accessing Localized Messages

The above discusses what files to create and where to store them, but doesn't address how to make use of that information.

Messages can be accessed in one of two ways:


	Using the "message:" binding _expression_ in a component template
	By injecting the component's Messages object
In the first case, you may use the message: binding prefix with 

[CONF] Apache Tapestry Localization

2013-01-21 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Added Vietnamese to list of supported languages


 Changes (2)
 




...
| bg (Bulgarian)  | fi (Finnish)   | mk (Macedonian)  | sr (Serbian)  | da (Danish) | fr (French)| nl (Dutch)   | sv (Swedish)  
| de (German) | hr (Croatian)  | no (Norwegian)   | zh (Chinese) vi (Vietnamese) 
| el (Greek)  | it (Italian)   | pt (Portuguese)  | zh (Chinese) 
 h3. Providing translations for Tapestry built-in messages 
...


Full Content

Localization


Related Articles


 Page:
 Templating and Markup FAQ





 Page:
 Component Classes





 Page:
 Component Parameters





 Page:
 Localization




 

Localization (aka L10n) is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Component Message Catalog Inheritance

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.

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.

Application-wide Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Avoid BOMsMake sure that your properties files don't contain byte order marks (BOM), because Java  and thus Tapestry  doesn't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Properties File Charset

Tapestry uses the UTF-8 character set (charset) when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool.

Localized Component Templates

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 MyPage_fr.html for 

[CONF] Apache Tapestry Localization

2013-01-20 Thread confluence







Localization
Page edited by Bob Harner


Comment:
Moved the redundant and out-of-place "Output Content Type and Charset" section to the existing "Content Type and Markup" page


 Changes (1)
 




...
 Note that the locale for a page is fixed (it cant 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 wont see a change to the pages locale (or localized messages) _in that request_. 
 h2. Output Content Type and Charset  When Tapestry renders a page, the very first step is to determine the output content type and charset.  This information is obtained from meta data on the page itself. Meta data is specified using the [@Meta|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/Meta.html] annotation.  The response content type is obtained via meta-data key {{tapestry.response-content-type}}. This value defaults to text/html.  As a convenience, the [@ContentType|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/annotations/ContentType.html] annotation can be used to specify the response content type. The value attribute of the annotation is the content type.  The character set for all outgoing markup and all incoming requests is UTF-8. UTF-8 is a version of Unicode where individual characters are encoded as one or more bytes. Most western language characters (that is, typical ASCII characters) are encoded in a single byte. Accented characters or non-western characters (such as Japanese, Arabic, etc.) may be encoded as two or more bytes. 


Full Content

Localization

Localization is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Properties File Charset

Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. Make sure that your properties files don't contain byte order marks (BOM) as Java - and thus Tapestry - doesn't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Message Catalog Inheritance

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.

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.

Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can 

[CONF] Apache Tapestry Localization

2011-04-05 Thread confluence







Localization
Page edited by Howard M. Lewis Ship


Comment:
Fix broken link


 Changes (1)
 




...
h2. Changing the Locale  
The service [PersistentLocale|http://tapestry.apache.org/current/apidocs/org/apache/tapestry5/services/PersistentLocale.html] is used to programmatically override the locale for the current request. 
 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 users bookmarks. 
...


Full Content

Localization

Localization is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Properties File Charset

Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. Make sure that your properties files don't contain byte order marks (BOM) as Java - and thus Tapestry - don't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Message Catalog Inheritance

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.

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.

Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Localized Component Templates

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 MyPage_fr.html for French users, and MyPage.html for all other users.

Accessing Localized Messages

The above discusses what files to create and where to store them, but doesn't address how to make use of that information.

Messages can be accessed in one of two ways:


	Using the message: binding prefix in a component template
	By injecting the component's Messages object
In the first case, you may use the message: binding prefix with component parameters, or with template expansions:





t:layout title="message:page-title"

  ${message:greeting}, ${user.name}!
  
  . . .
/t:layout



Here, the page-title message is extracted from the catalog and passed to the Border component's title parameter.

In addition, the greeting message is extracted and 

[CONF] Apache Tapestry Localization

2011-01-26 Thread confluence







Localization
Page edited by Ulrich Stärk


Comment:
TAP5-409


 Changes (1)
 




...
h2. Properties File Charset  
Tapestry uses the {{UTF-8}} charset when reading the properties files in a message catalog. This means that you dont have to use the Java {{native2ascii}} tool. Make sure that your properties files dont contain [byte order marks (BOM)|http://en.wikipedia.org/wiki/Byte_order_mark] as Java - and thus Tapestry - dont support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out. 
 h3. Message Catalog Inheritance 
...


Full Content

Localization

Localization is all about getting the right text to the user, in the right language.

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.

Component Message Catalogs

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 key=value. These files are stored on the classpath, in the same package folder as the page or component's compiled Java class.

So for a class named org.example.myapp.pages.MyPage, you would have a main properties file as org/example/myapp/pages/MyPage.properties.

If you have a translations of these values, you provide additional properties file, adding an ISO language code before the extension. Thus, if you have a French translation, you could create a file MyPage_fr.properties.

Any values in the more language specific file will override values from the main properties file. If you had an even more specific localization for just French as spoken in France, you could create MyPage_fr_FR.properties (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).

The messages in the catalog are accessed by keys. Tapestry ignores the case of the keys when accessing messages in the catalog.

Properties File Charset

Tapestry uses the UTF-8 charset when reading the properties files in a message catalog. This means that you don't have to use the Java native2ascii tool. Make sure that your properties files don't contain byte order marks (BOM) as Java - and thus Tapestry - don't support BOM in properties files (see http://bugs.sun.com/view_bug.do?bug_id=4508058). Some editors write them out when saving a file in UTF-8, so watch out.

Message Catalog Inheritance

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.

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.

Application Message Catalog

If the file WEB-INF/AppName.properties exists in the context, it will be used as an application-wide message catalog. The AppName is derived from the name of the filter inside the web.xml file; this is most often just "app", thus WEB-INF/app.properties. The search for the file is case sensitive. The properties files may be localized.

Individual pages and components can override the values defined in the message catalog.

Localized Component Templates

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 MyPage_fr.html for French users, and MyPage.html for all other users.

Accessing Localized Messages

The above discusses what files to create and where to store them, but doesn't address how to make use of that information.

Messages can be accessed in one of two ways:


	Using the message: binding prefix in a component template
	By injecting the component's Messages object
In the first case, you may use the message: binding prefix with component parameters, or with template expansions:





t:layout title="message:page-title"

  ${message:greeting}, ${user.name}!
  
  . . .
/t:layout



Here, the page-title message is extracted from the catalog and passed to the Border component's title parameter.

In