DataFaucet ORM

Internationalization (i18n)

For applications that present content in multiple languages the DataFaucet system provides several localization (l10n) features you can use to customize data access for a specific region. These features are neatly bundled into a component called a Localization object (localization.cfc) in the system directory.

The localization object has five responsibilities:

The localization object has these properties

localen/aThe locale (language and region) associated with the current request.
timezoneUTCthe ID of a Java timezone from which times should be converted to UTC
resourcePath/datafaucet/i18npath to a resource bundle file - OR - a directory containing resource bundles for translating filter keywords - if a resource bundle path is not supplied or not found, the localization object defaults to using the file /datafaucet/i18n/
charsetISO-8859-1indicates the character set used in resource bundles found in the resourcePath directory - if ISO-8859-1 then resource bundles will be read via Java (slower) otherwise they'll be read via ColdFusion
sortStrengthTERTIARYthe default strength for Java collation when sorting query results
sortDecompFULLthe default decomposition for Java collation when sorting query results

The localization used for a given query defaults to a localization object set during each page request and accessible via the bootstrap method getLocalization().

<cfset loc = request.DataFaucet.getLocalization() />

Localizations can also be set within a datasource object or within an individual SQL Statement object using the respective setLocalization() method. If set these localizations will override the localization for the individual request.