From 12f6ceb622b2bf6d65e86d9bf1a908c924aa32e1 Mon Sep 17 00:00:00 2001 From: Lildirt Date: Wed, 1 Mar 2023 11:26:02 -0500 Subject: [PATCH] i18n: Remove command --- .../MultiverseCore/commands/RemoveCommand.java | 10 ++++++---- .../onarandombox/MultiverseCore/utils/MVCorei18n.java | 4 ++++ src/main/resources/multiverse-core_en.properties | 5 +++++ 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java index e011a2ca..2032af53 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/RemoveCommand.java @@ -10,6 +10,7 @@ import co.aikar.commands.annotation.Single; import co.aikar.commands.annotation.Subcommand; import co.aikar.commands.annotation.Syntax; import com.onarandombox.MultiverseCore.MultiverseCore; +import com.onarandombox.MultiverseCore.utils.MVCorei18n; import org.bukkit.ChatColor; import org.jetbrains.annotations.NotNull; @@ -23,19 +24,20 @@ public class RemoveCommand extends MultiverseCoreCommand { @CommandPermission("multiverse.core.remove") @CommandCompletion("@mvworlds:scope=both") @Syntax("") - @Description("Unloads a world from Multiverse and removes it from worlds.yml, this does NOT DELETE the world folder.") + @Description("{@@mv-core.remove.description}") public void onRemoveCommand(BukkitCommandIssuer issuer, @Single @Conditions("mvworlds:scope=both") @Syntax("") - @Description("World you want to remove from mv's knowledge.") + @Description("{@@mv-core.remove.world.description}") String worldName ) { if (!this.plugin.getMVWorldManager().removeWorldFromConfig(worldName)) { - issuer.sendMessage(String.format("%sError trying to remove world from config!", ChatColor.RED)); + issuer.sendInfo(MVCorei18n.REMOVE_FAILED); return; } - issuer.sendMessage(String.format("World '%s' is removed from config!", worldName)); + issuer.sendInfo(MVCorei18n.REMOVE_SUCCESS, + "{world}", worldName); } } diff --git a/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java b/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java index 763c2c98..77274bdb 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java +++ b/src/main/java/com/onarandombox/MultiverseCore/utils/MVCorei18n.java @@ -54,6 +54,10 @@ public enum MVCorei18n implements MessageKeyProvider { // reload command RELOAD_RELOADING, RELOAD_SUCCESS, + + // remove command + REMOVE_FAILED, + REMOVE_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 fd2a355d..9ffd0a31 100644 --- a/src/main/resources/multiverse-core_en.properties +++ b/src/main/resources/multiverse-core_en.properties @@ -65,6 +65,11 @@ 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.remove.description=Unloads a world from Multiverse and removes it from worlds.yml. This does NOT delete the world folder. +mv-core.remove.world.description=World you want to remove from MV's knowledge. +mv-core.remove.failed=Error trying to remove world from config! +mv-core.remove.success=World '{world}' is removed from config! 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.