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 TypeMethodDescriptionvoid
disable()
Disables the i18n handler.void
enable()
Enables the i18n handler.void
reloadConfiguration
(@NotNull Configuration configuration) Called when the configuration is reloaded.void
Changes the locale of the internationalization handler.static String
Translates 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:
reloadConfiguration
in interfaceConfigurationConsumer
- Parameters:
configuration
- The configuration.
-