org.pdfsam.guiclient.l10n
Class LanguageLoader

java.lang.Object
  extended by org.pdfsam.guiclient.l10n.LanguageLoader

public class LanguageLoader
extends java.lang.Object

Loader for the i18n resource bundle

Author:
Andrea Vacondio

Field Summary
static java.lang.String DEFAULT_LANGUAGE
           
static java.util.Locale DEFAULT_LOCALE
           
 
Constructor Summary
LanguageLoader(java.lang.String languageCode, java.lang.String bundle)
          Creates a loader for the ResourceBundle
 
Method Summary
 java.util.ResourceBundle getBundle()
           
 java.util.ResourceBundle getBundle(java.lang.ClassLoader cl)
           
 void setBundleName(java.lang.String bundleName)
           
 void setLocale(java.util.Locale currentLocale)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_LANGUAGE

public static final java.lang.String DEFAULT_LANGUAGE
See Also:
Constant Field Values

DEFAULT_LOCALE

public static final java.util.Locale DEFAULT_LOCALE
Constructor Detail

LanguageLoader

public LanguageLoader(java.lang.String languageCode,
                      java.lang.String bundle)
Creates a loader for the ResourceBundle

Parameters:
languageCode - language code "en_GB", "it_IT", "pt_BR"...
bundle - string rapresenting the bundle name
Method Detail

getBundle

public java.util.ResourceBundle getBundle()
Returns:
the ResourceBundle associated with the bundleName and current_local. If an exception is rised it tries to return bundleName but default_locale

getBundle

public java.util.ResourceBundle getBundle(java.lang.ClassLoader cl)
Returns:
the ResourceBundle associated with the bundleName and current_local. If an exception is rised it tries to return bundleName but default_locale

setBundleName

public void setBundleName(java.lang.String bundleName)
Parameters:
bundleName - The bundleName to set.

setLocale

public void setLocale(java.util.Locale currentLocale)
Parameters:
currentLocale - The locale to set.