public class LocalizationData extends Object
Modifier and Type | Field and Description |
---|---|
static LocalizationData |
DEFAULT |
static String |
DEFAULT_BUNDLE_NAME |
Constructor and Description |
---|
LocalizationData(String bundlePath)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
add(String bundlePath)
Adds a bundle path to this.
|
String |
getString(String key)
Gets a wording for default locale.
|
String |
getString(String key,
Locale locale)
Gets a wording for a locale.
|
static Locale |
getSystemLocale() |
void |
setTranslatorMode(boolean translatorMode) |
public static final String DEFAULT_BUNDLE_NAME
public static LocalizationData DEFAULT
public LocalizationData(String bundlePath)
bundlePath
- The main bundlePathadd(String)
public static Locale getSystemLocale()
public void add(String bundlePath)
bundlePath
- The path of the bundle to add.public String getString(String key, Locale locale)
key
- The wording's keylocale
- The locale.ResourceBundle.getBundle(String)
) for more information).
Locale.setDefault(Locale)
) to the desired locale.MissingResourceException
- if the key is unknownpublic String getString(String key)
key
- The wording's keyMissingResourceException
- if the key is unknowngetString(String, Locale)
public void setTranslatorMode(boolean translatorMode)
Copyright © 2022. All rights reserved.