Package com.biglybt.core.internat
Class MessageText
java.lang.Object
com.biglybt.core.internat.MessageText
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static int
(package private) static final String
private static IntegratedResourceBundle
static final String
private static final List
private static Locale
static final Locale
static final Locale
private static final boolean
private static final Pattern
private static Set
private static final String
private static final Map
private static final Collection
(package private) static IntegratedResourceBundle
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
static void
addListener
(MessageText.MessageTextListener listener) static boolean
changeLocale
(Locale newLocale) private static boolean
changeLocale
(Locale newLocale, boolean force) static String
expandValue
(String value) static Locale
static String
static Locale
static Locale[]
getLocales
(boolean sort) static String
static String
getPlatformNeutralString
(String key, String sDefault) (package private) static ResourceBundle
getResourceBundle
(String name, Locale loc, ClassLoader cl) private static String
static String
static String
static String
Expands a message text and replaces occurrences of %1 with first param, %2 with second...static StringSupplier
getStringProvider
(String key, String... params) Supplier of localized string for given key.private static String
static boolean
integratePluginMessages
(String localizationPath, ClassLoader classLoader) static boolean
static boolean
isCurrentLocale
(Locale locale) static boolean
static boolean
static void
static void
loadBundle
(boolean forceReload) (package private) static Locale
parseFormattedLocaleString
(String savedLocaleString) static void
protected static String
replaceStrings
(String str, String f_s, String t_s) private static void
static void
Sets keys for system wide constants
-
Field Details
-
LOCALE_ENGLISH
-
LOCALE_DEFAULT
-
LOG_MISSING_MESSAGES
private static final boolean LOG_MISSING_MESSAGES -
LOCALE_CURRENT
-
BUNDLE_NAME
-
CONSTANTS
-
DEFAULT_BUNDLE_NAME
- See Also:
-
pluginLocalizationPaths
-
pluginResourceBundles
-
RESOURCE_BUNDLE
-
platform_specific_keys
-
PAT_PARAM_ALPHA
-
bundle_fail_count
private static int bundle_fail_count -
listeners
-
PLATFORM_SUFFIX
-
DEFAULT_BUNDLE
-
substitutes
-
-
Constructor Details
-
MessageText
public MessageText()
-
-
Method Details
-
updateProductName
public static void updateProductName()Sets keys for system wide constants -
loadBundle
public static void loadBundle() -
loadBundle
public static void loadBundle(boolean forceReload) -
addListener
-
addAndFireListener
-
removeListener
-
getResourceBundle
-
setResourceBundle
-
keyExists
-
keyExistsForDefaultLocale
-
getString
- Parameters:
key
-- Returns:
-
getString
-
getPlatformNeutralString
-
getPlatformNeutralString
-
getResourceBundleString
-
expandValue
-
getUISuffix
-
getString
Expands a message text and replaces occurrences of %1 with first param, %2 with second...- Parameters:
key
-params
-- Returns:
-
replaceStrings
-
getDefaultLocaleString
-
getCurrentLocale
-
isCurrentLocale
-
getLocales
-
changeLocale
-
changeLocale
-
integratePluginMessages
-
integratePluginMessages
-
getDisplaySubstitute
-
parseFormattedLocaleString
- Returns:
- matching Locale or
Locale.ROOT
if unrecognized format or imparsable.
-
getStringProvider
Supplier of localized string for given key. The string construction is lazy evaluated.
-