14.01.2013 Views

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

Oracle JHeadstart Developer's Guide - Downloads - Oracle

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

11.1. National Language Support in <strong>JHeadstart</strong><br />

JSF has built-in support for using property files or resource bundle classes as message<br />

resource bundles. Message resource bundles can be used to make your application multilingual.<br />

If you do not have internationalization requirements, it is still useful to use<br />

message resource bundles to store “hard coded” text strings in a central place, where<br />

they can be easily found and maintained.<br />

When generating your application, <strong>JHeadstart</strong> generates a resource bundle that holds<br />

translatable text. The name of the resource bundle can be specified in the Service-level<br />

property NLS Resource Bundle. Using the Resource Bundle Type property you can<br />

specify whether the resource bundle is generated as a property file, a java class or a<br />

database table.<br />

A property file is easiest to maintain by developers, it is a simple text file with key-value<br />

pairs. However, a property file does not handle special symbols well. A Java-based<br />

resource bundle is better suited for this. If you want the page text to be maintained or<br />

translated by a super user or system administrator, then using a database table as<br />

resource bundle is the best choice. See section Using Resource Bundle Type Database<br />

Table for more information.<br />

Button labels, page header titles, and other fixed “boilerplate text” generated by<br />

<strong>JHeadstart</strong> are always generated into the resource bundle. However, if your application<br />

should be truly multi-lingual, meaning that the generated pages cannot contain<br />

hardcoded text at all, you should check the checkbox Generate NLS-enabled prompts<br />

and tabs as well. When checked, the prompts, tab names and display titles that you<br />

specify in the Application Definition Editor will also be generated into the resource<br />

bundle.<br />

In the Generator Default Locale property, you specify the locale that should be used to<br />

populate the default resource bundle, which is the bundle that does not have the locale<br />

suffixed to the name, for example ApplicationResources.properties. This<br />

resource bundle is used when the user’s browser is set to a locale that is not supported<br />

by your application.<br />

In the Generator Locales property, you can optionally specify all other locales that must<br />

be supported by your application as a comma delimited list. For each locale in this<br />

property <strong>JHeadstart</strong> generates a resource bundle with the name as specified in the NLS<br />

Resource Bundle property, suffixed with the locale code, for example<br />

11 - 2 Internationalization <strong>JHeadstart</strong> Developer’s <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!