org.jopendocument.util.i18n
Class I18nUtils

java.lang.Object
  extended by org.jopendocument.util.i18n.I18nUtils

public final class I18nUtils
extends Object


Nested Class Summary
static class I18nUtils.SameLanguageControl
           
 
Field Summary
static String FALSE_KEY
           
static String NO_KEY
           
static String RSRC_BASENAME
           
static String TRUE_KEY
           
static String YES_KEY
           
 
Constructor Summary
I18nUtils()
           
 
Method Summary
static Locale createLocaleFromString(String localeString)
          Convert a string into a Locale Object.
protected static String getBaseName(Class<?> c)
           
static String getBooleanKey(boolean b)
           
static ResourceBundle.Control getSameLanguageControl()
          Returns a Control that only loads bundle with the requested language.
static String getYesNoKey(boolean b)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RSRC_BASENAME

public static final String RSRC_BASENAME

TRUE_KEY

public static final String TRUE_KEY
See Also:
Constant Field Values

FALSE_KEY

public static final String FALSE_KEY
See Also:
Constant Field Values

YES_KEY

public static final String YES_KEY
See Also:
Constant Field Values

NO_KEY

public static final String NO_KEY
See Also:
Constant Field Values
Constructor Detail

I18nUtils

public I18nUtils()
Method Detail

getBaseName

protected static final String getBaseName(Class<?> c)

getSameLanguageControl

public static ResourceBundle.Control getSameLanguageControl()
Returns a Control that only loads bundle with the requested language. I.e. no fallback and no base bundle.

Returns:
a control only loading the requested language.
See Also:
ResourceBundle.getBundle(String, Locale, ClassLoader, Control)

getBooleanKey

public static final String getBooleanKey(boolean b)

getYesNoKey

public static final String getYesNoKey(boolean b)

createLocaleFromString

public static Locale createLocaleFromString(String localeString)
Convert a string into a Locale Object. Waiting for Locale.forLanguageTag() in java 7.

Parameters:
localeString - a String returned from Locale.toString().
Returns:
the Locale.


Copyright © 2010 jOpenDocument All Rights Reserved.