com.plumtree.openfoundation.internationalization
Class XPLanguageResourceSet

java.lang.Object
  extended bycom.plumtree.openfoundation.internationalization.XPLanguageResourceSet

public class XPLanguageResourceSet
extends java.lang.Object

XPLanguageResourceSet is similar to XPResourceSet, except that it maps a locale or language identifier to the human readable string that describes that language or locale.


Constructor Summary
XPLanguageResourceSet()
           
 
Method Summary
 java.lang.String GetDisplayLanguageFromLocaleID(java.lang.String sLocaleID)
          MES- GetDisplayLanguageFromLocaleID is used to convert from a locale identifier (e.g.
 java.lang.String GetDisplayLocaleFromLocaleID(java.lang.String sLocaleID)
          This method converts from a locale identifier (e.g.
 java.lang.String[] GetSupportedLocales()
          MES- GetSupportedLocales returns an array of the locales that are mapped to languages in the UI.
protected  void LoadResource(java.lang.String sFileName, java.lang.String[] arrSupportedLanguageIDs)
          MES- LoadResource is used to load an instance of this class with the contents of a PropertyBag file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XPLanguageResourceSet

public XPLanguageResourceSet()
Method Detail

GetDisplayLocaleFromLocaleID

public java.lang.String GetDisplayLocaleFromLocaleID(java.lang.String sLocaleID)
This method converts from a locale identifier (e.g. "en-us") to the human readable string that describes that locale (e.g. "U.S. English".) If a language ID is passed in instead of a locale ID, the language will be converted (e.g. "en" will be converted to "English".)

Parameters:
sLocaleID - is the ID of the locale to be looked up
Returns:
The description of the locale, or the locale ID if no description is available

GetDisplayLanguageFromLocaleID

public java.lang.String GetDisplayLanguageFromLocaleID(java.lang.String sLocaleID)
MES- GetDisplayLanguageFromLocaleID is used to convert from a locale identifier (e.g. "en-us") to the human readable string that describes the language associated with the locale (e.g. "English".) If a language identifier is passed in (e.g. "en"), the string for that language will be returned.

Parameters:
sLocaleID - is the ID of the locale to be looked up
Returns:
The description of the locale, or the locale ID if no description is available

GetSupportedLocales

public java.lang.String[] GetSupportedLocales()
MES- GetSupportedLocales returns an array of the locales that are mapped to languages in the UI. For example, if the "msgs" directory contains folders for "en" and "fr", then "en-us" would be a supported locale, as would "en". "it" and "it-ch" would NOT be supported locales, even if we know the localized description for "it" from the Locales.xml file.

Returns:
an array of the identifiers of supported locales- note that a locale can be known without being supported.

LoadResource

protected void LoadResource(java.lang.String sFileName,
                            java.lang.String[] arrSupportedLanguageIDs)
                     throws XPException
MES- LoadResource is used to load an instance of this class with the contents of a PropertyBag file.

Parameters:
sFileName - is the name of the PropertyBag file we're loading
arrSupportedLanguageIDs - is a string array containing the Language IDs of all the languages the UI supports (i.e. the names of all folders under the msgs folder.
Throws:
XPException


Copyright 2002, 2003, 2004 Plumtree Software Inc. All Rights Reserved.