public class LocaleManager
extends java.lang.Object
Plugin
.
Locales are loaded as .properties
files from the
/lang
directory of the archive of the plugin owning this
LocaleManager
.
Constructor and Description |
---|
LocaleManager(org.bukkit.plugin.Plugin plugin)
Constructs a new
LocaleManager owned by the given Plugin . |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDefaultLocale()
Gets the default locale of this
LocaleManager . |
Localizable |
getLocalizable(java.lang.String key)
Gets the
Localizable associated with the given key. |
org.bukkit.plugin.Plugin |
getOwningPlugin()
Gets the plugin owning this
LocaleManager . |
void |
setDefaultLocale(java.lang.String locale)
Sets the default locale of this
LocaleManager . |
public LocaleManager(org.bukkit.plugin.Plugin plugin)
LocaleManager
owned by the given Plugin
.plugin
- The plugin owning the new LocaleManager
.public org.bukkit.plugin.Plugin getOwningPlugin()
LocaleManager
.LocaleManager
public java.lang.String getDefaultLocale()
LocaleManager
.ISO 639-1
and ISO 3166-1
standards,
respectively (e.g. en_US
) and defaults to en_US
.public void setDefaultLocale(java.lang.String locale)
LocaleManager
.locale
- A string representing the default locale. This should
follow the ISO 639-1
and ISO 3166-1
standards,
respectively (e.g. en_US
or enUS
) and defaults to
en_US
.public Localizable getLocalizable(java.lang.String key)
Localizable
associated with the given key.key
- The key of the message to retrieveLocalizable