From ca0f6febb5086332fd11bf9966eb14f228cac3b2 Mon Sep 17 00:00:00 2001 From: Lildirt Date: Wed, 1 Mar 2023 11:25:26 -0500 Subject: [PATCH] i18n: Reload command --- .../MultiverseCore/commands/ReloadCommand.java | 8 +++++--- .../com/onarandombox/MultiverseCore/utils/MVCorei18n.java | 4 ++++ src/main/resources/multiverse-core_en.properties | 4 ++++ 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java index 2f71394c..1adaba2a 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/ReloadCommand.java @@ -10,6 +10,7 @@ import co.aikar.commands.annotation.Description; import co.aikar.commands.annotation.Subcommand; import com.onarandombox.MultiverseCore.MultiverseCore; import com.onarandombox.MultiverseCore.event.MVConfigReloadEvent; +import com.onarandombox.MultiverseCore.utils.MVCorei18n; import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; @@ -21,9 +22,9 @@ public class ReloadCommand extends MultiverseCoreCommand { @Subcommand("reload") @CommandPermission("multiverse.core.reload") - @Description("Reloads config files for all multiverse modules.") + @Description("{@@mv-core.reload.description}") public void onReloadCommand(@NotNull BukkitCommandIssuer issuer) { - issuer.sendMessage(ChatColor.GOLD + "Reloading all Multiverse Plugin configs..."); + issuer.sendInfo(MVCorei18n.RELOAD_RELOADING); this.plugin.loadConfigs(); this.plugin.getAnchorManager().loadAnchors(); this.plugin.getMVWorldManager().loadWorlds(true); @@ -36,7 +37,8 @@ public class ReloadCommand extends MultiverseCoreCommand { MVConfigReloadEvent configReload = new MVConfigReloadEvent(configsLoaded); this.plugin.getServer().getPluginManager().callEvent(configReload); + // @TODO: replace this sendMessage and format the configsLoaded above, maybe? configReload.getAllConfigsLoaded().forEach(issuer::sendMessage); - issuer.sendMessage(String.format("%sReload Complete!", ChatColor.GREEN)); + issuer.sendInfo(MVCorei18n.RELOAD_SUCCESS); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java index 2248652b..763c2c98 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java @@ -50,6 +50,10 @@ public enum MVCorei18n implements MessageKeyProvider { REGEN_FAILED, REGEN_SUCCESS, REGEN_PROMPT, + + // reload command + RELOAD_RELOADING, + RELOAD_SUCCESS, DEBUG_INFO_OFF, DEBUG_INFO_ON; diff --git a/src/main/resources/multiverse-core_en.properties b/src/main/resources/multiverse-core_en.properties index 816a4039..fd2a355d 100644 --- a/src/main/resources/multiverse-core_en.properties +++ b/src/main/resources/multiverse-core_en.properties @@ -61,6 +61,10 @@ mv-core.regen.regenerating=Regenerating world '{world}'... mv-core.regen.failed=There was an issue regenerating '{world}'! Please check console for errors. mv-core.regen.success=World {world} was regenerated! mv-core.regen.prompt=Are you sure you want to regenerate world '{world}'? + +mv-core.reload.description=Reloads config files for all Multiverse modules. +mv-core.reload.reloading=Reloading all Multiverse Plugin configs... +mv-core.reload.success=Reload complete! mv-core.debug.info.description=Show the current debug level. mv-core.debug.info.off=&fMultiverse Debug mode is &cOFF&f. mv-core.debug.info.on=&fMultiverse Debug mode is at &alevel {level}&f.