Class I18n

java.lang.Object
dev.satyrn.xpeconomy.lang.I18n
All Implemented Interfaces:
ConfigurationConsumer

public final class I18n extends Object implements ConfigurationConsumer
Message internationalization for Experience Economy
  • Constructor Details

    • I18n

      public I18n(org.bukkit.plugin.Plugin plugin, @NotNull @NotNull Configuration configuration)
      Initializes a new I18n instance.
      Parameters:
      plugin - The parent plugin instance.
  • Method Details

    • tr

      public static String tr(String key, Object... format)
      Translates a resource string to the current locale.
      Parameters:
      key - The translation key.
      format - The translation format.
      Returns:
      The translated message.
    • setLocale

      public void setLocale(String locale)
      Changes the locale of the internationalization handler.
      Parameters:
      locale - The new locale to use.
    • enable

      public void enable()
      Enables the i18n handler.
    • disable

      public void disable()
      Disables the i18n handler.
    • reloadConfiguration

      public void reloadConfiguration(@NotNull @NotNull Configuration configuration)
      Called when the configuration is reloaded. Sets the state of the consumer based on the new configuration.
      Specified by:
      reloadConfiguration in interface ConfigurationConsumer
      Parameters:
      configuration - The configuration.