org.formaria.langmgr
Class EncodedLanguageResourceBundleLoader

java.lang.Object
  extended by org.formaria.langmgr.EncodedLanguageResourceBundleLoader
All Implemented Interfaces:
ResourceBundleLoader

public class EncodedLanguageResourceBundleLoader
extends java.lang.Object
implements ResourceBundleLoader

A resource bundle loader interface for a language resources. See the Localization chapter of the Aria User Guide for more detail.

Aria uses standard property files for localization. These localization files can be set for an individual page (by setting the 'resource' attribute of the Page element or for the component factory. The project's resource manager is used to identify the current locale and the name of the property file by default.

This resource loader allows resource bundles in non-latin encodings to be loaded. The loader also processes a list of font substitutions

Copyright (c) Formaria Ltd., 2008, see license.txt for licesning information

$Revision: 1.2 $


Field Summary
protected  Project currentProject
           
protected  java.lang.String encoding
           
protected  java.util.Properties encodingProperties
           
 
Constructor Summary
EncodedLanguageResourceBundleLoader(Project project)
          Creates a new instance of EncodedLanguageResourceBundleLoader
 
Method Summary
 java.lang.String getLanguageProperty(java.lang.String key)
          Get a property associated with the language of the current resource bundle.
 java.util.ResourceBundle getResourceBundle(java.lang.String name)
          Get the named resource bundle
 void setEncoding(java.lang.String nextEncoding)
          Set the default encoding for loading of the next resource bundle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

encoding

protected java.lang.String encoding

currentProject

protected Project currentProject

encodingProperties

protected java.util.Properties encodingProperties
Constructor Detail

EncodedLanguageResourceBundleLoader

public EncodedLanguageResourceBundleLoader(Project project)
Creates a new instance of EncodedLanguageResourceBundleLoader

Method Detail

setEncoding

public void setEncoding(java.lang.String nextEncoding)
Set the default encoding for loading of the next resource bundle

Parameters:
nextEncoding - the next encoding to use when reading a resource bundle file

getResourceBundle

public java.util.ResourceBundle getResourceBundle(java.lang.String name)
Get the named resource bundle

Specified by:
getResourceBundle in interface ResourceBundleLoader
Parameters:
name - the bundle name
Returns:
the bundle

getLanguageProperty

public java.lang.String getLanguageProperty(java.lang.String key)
Get a property associated with the language of the current resource bundle.

Parameters:
key - the key to lookup
Returns:
value the value or the key if no value is listed in the property_encodings file