Package dev.satyrn.xpeconomy.lang
Class I18n
java.lang.Object
dev.satyrn.xpeconomy.lang.I18n
- All Implemented Interfaces:
ConfigurationConsumer
Message internationalization for Experience Economy
-
Constructor Summary
ConstructorsConstructorDescriptionI18n(org.bukkit.plugin.Plugin plugin, @NotNull Configuration configuration) Initializes a new I18n instance. -
Method Summary
Modifier and TypeMethodDescriptionvoiddisable()Disables the i18n handler.voidenable()Enables the i18n handler.voidreloadConfiguration(@NotNull Configuration configuration) Called when the configuration is reloaded.voidChanges the locale of the internationalization handler.static StringTranslates a resource string to the current locale.
-
Constructor Details
-
I18n
Initializes a new I18n instance.- Parameters:
plugin- The parent plugin instance.
-
-
Method Details
-
tr
Translates a resource string to the current locale.- Parameters:
key- The translation key.format- The translation format.- Returns:
- The translated message.
-
setLocale
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
Called when the configuration is reloaded. Sets the state of the consumer based on the new configuration.- Specified by:
reloadConfigurationin interfaceConfigurationConsumer- Parameters:
configuration- The configuration.
-