Class LocaleManager

java.lang.Object
net.caseif.rosetta.LocaleManager

public class LocaleManager extends Object
Provides localization support for a particular Plugin.

Locales are loaded as .properties files from the /lang directory of the archive of the plugin owning this LocaleManager.

Since:
1.0
  • Constructor Details

    • LocaleManager

      public LocaleManager(org.bukkit.plugin.Plugin plugin)
      Constructs a new LocaleManager owned by the given Plugin.
      Parameters:
      plugin - The plugin owning the new LocaleManager.
      Since:
      1.0
  • Method Details

    • getOwningPlugin

      public org.bukkit.plugin.Plugin getOwningPlugin()
      Gets the plugin owning this LocaleManager.
      Returns:
      The plugin owning this LocaleManager
      Since:
      1.0
    • getDefaultLocale

      public String getDefaultLocale()
      Gets the default locale of this LocaleManager.
      Returns:
      A string representing the default locale. This should follow the ISO 639-1 and ISO 3166-1 standards, respectively (e.g. en_US) and defaults to en_US.
      Since:
      1.0
    • setDefaultLocale

      public void setDefaultLocale(String locale)
      Sets the default locale of this LocaleManager.
      Parameters:
      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.
      Since:
      1.0
    • getLocalizable

      public Localizable getLocalizable(String key)
      Gets the Localizable associated with the given key.
      Parameters:
      key - The key of the message to retrieve
      Returns:
      The retrieved message as a Localizable
      Since:
      1.0