public class Locale
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
java.util.Map<java.lang.String,java.lang.String> |
messages
The messages stored by this local manager.
|
java.lang.String |
plugin
The name of the plugin this locale manager belongs to.
|
java.util.List<java.lang.String> |
undefinedMessages
An enumeration of message keys found in the default locale, but not the
defined one.
|
Constructor and Description |
---|
Locale(java.lang.String plugin)
Creates a new locale manager for the given plugin (yours).
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getMessage(java.lang.String key)
Retrieves the message with the given key from the
current locale.
|
java.lang.String |
getMessage(java.lang.String key,
java.lang.String... replacements)
Retrieves the message with the given key from the
current locale, and replaces placeholder sequences
(
%i ) with the corresponding vararg
parameter. |
void |
initialize()
Initializes the locale manager.
|
boolean |
isLegacy()
Returns whether this object was loaded from a legacy
locale file.
|
public java.lang.String plugin
public final java.util.Map<java.lang.String,java.lang.String> messages
public final java.util.List<java.lang.String> undefinedMessages
public Locale(java.lang.String plugin)
plugin
- the plugin to create a locale manager forpublic java.lang.String getMessage(java.lang.String key)
This method is redundant, but included for signature reverse-compatibility.
key
- the key of the message to retrievepublic java.lang.String getMessage(java.lang.String key, java.lang.String... replacements)
%i
) with the corresponding vararg
parameter.
Note: placeholder sequences should start at index 1.
key
- the key of the message to retrievereplacements
- an array or vararg list of
strings to replace placeholder sequences (%i) withpublic boolean isLegacy()
public void initialize()
getMessage(String, String...)
will always return its
parameter.