public class LanguagePackMessages extends Object
ResourceBundle
and offers some convenience methods to use for
PingFederate localization.
ResourceBundle
Modifier and Type | Field and Description |
---|---|
static String |
LANGUAGE_PACK_DIR_NAME
Name of the directory used to store PingFederate language packs.
|
Constructor and Description |
---|
LanguagePackMessages(String resourceBundleBaseName,
Locale locale)
Construct an instance of LanguagePackMessages.
|
Modifier and Type | Method and Description |
---|---|
String |
getMessage(String key)
Retrieves a localized message for the key passed in.
|
String |
getMessage(String keyPrefix,
String key)
Retrieves a localized message for the prefix and kegey passed in.
|
String |
getMessage(String key,
String[] substitutions)
Retrieves a localized message for the key and substitutions passed in.
|
String |
getMessage(String keyPrefix,
String key,
String... substitutions)
Retrieves a localized message for the prefix, key, and substitutions passed in.
|
String |
getMessageWithDefault(String key,
String defaultMessage)
Retrieves a localized message for the key prefix and key passed in.
|
String |
getMessageWithDefault(String keyPrefix,
String key,
String defaultMessage)
Retrieves a localized message for the key prefix and key passed in.
|
String |
getMessageWithDefault(String key,
String defaultMessage,
String[] substitutions)
Retrieves a localized message for the key prefix and key passed in.
|
String |
getMessageWithDefault(String keyPrefix,
String key,
String defaultMessage,
String[] substitutions)
Retrieves a localized message for the key prefix and key passed in.
|
ResourceBundle |
getResourceBundle()
Returns the
ResourceBundle backing this class. |
public static final String LANGUAGE_PACK_DIR_NAME
public LanguagePackMessages(String resourceBundleBaseName, Locale locale)
ResourceBundle
using the
provided resource bundle base name. For example, "pingfederate-messages" is the base name for the resource bundle shipped with PingFederate.resourceBundleBaseName
- The base name for the resource bundle.locale
- The Locale
to use when retrieving localized messages.ResourceBundle
,
Locale
public String getMessage(String key)
key
- Key used to search for localized message.public String getMessage(String keyPrefix, String key)
keyPrefix
- The prefix used to prepend to the key.key
- Key used to search for localized message.public String getMessage(String keyPrefix, String key, String... substitutions)
keyPrefix
- The prefix used to prepend to the key.key
- Key used to search for localized message.substitutions
- The array of substitutions to use in the message.public String getMessage(String key, String[] substitutions)
key
- Key used to search for localized message.substitutions
- The array of substitutions to use in the message.public String getMessageWithDefault(String keyPrefix, String key, String defaultMessage)
keyPrefix
- The prefix used to prepend to the key.key
- Key used to search for localized message.defaultMessage
- The default message to use if no localized string is found.public String getMessageWithDefault(String key, String defaultMessage)
key
- Key used to search for localized message.defaultMessage
- The default message to use if no localized string is found.public String getMessageWithDefault(String keyPrefix, String key, String defaultMessage, String[] substitutions)
keyPrefix
- The prefix used to prepend to the key.key
- Key used to search for localized message.defaultMessage
- The default message to use if no localized string is found.substitutions
- The array of substitutions to use in the message.public String getMessageWithDefault(String key, String defaultMessage, String[] substitutions)
key
- Key used to search for localized message.defaultMessage
- The default message to use if no localized string is found.substitutions
- The array of substitutions to use in the message.public ResourceBundle getResourceBundle()
ResourceBundle
backing this class.ResourceBundle
backing this class.Copyright 2019 Ping Identity Corp. All rights reserved.