|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.eclipse.jgit.nls.NLS
public class NLS
The purpose of this class is to provide NLS (National Language Support) configurable per thread.
The setLocale(Locale)
method is used to configure locale for the
calling thread. The locale setting is thread inheritable. This means that a
child thread will have the same locale setting as its creator thread until it
changes it explicitly.
Example of usage:
NLS.setLocale(Locale.GERMAN); TransportText t = NLS.getBundleFor(TransportText.class);
Field Summary | |
---|---|
static Locale |
ROOT_LOCALE
The root locale constant. |
Method Summary | ||
---|---|---|
static
|
getBundleFor(Class<T> type)
Returns an instance of the translation bundle of the required type. |
|
static void |
setLocale(Locale locale)
Sets the locale for the calling thread. |
|
static void |
useJVMDefaultLocale()
Sets the JVM default locale as the locale for the calling thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Locale ROOT_LOCALE
Method Detail |
---|
public static void setLocale(Locale locale)
The getBundleFor(Class)
method will honor this setting if if it
is supported by the provided resource bundle property files. Otherwise,
it will use a fall back locale as described in the
TranslationBundle
locale
- the preferred localepublic static void useJVMDefaultLocale()
Semantically this is equivalent to NLS.setLocale(Locale.getDefault())
.
public static <T extends TranslationBundle> T getBundleFor(Class<T> type)
TranslationBundle
.
T
- required bundle typetype
- required bundle type
TranslationBundleLoadingException
- see TranslationBundleLoadingException
TranslationStringMissingException
- see TranslationStringMissingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |