From f3addfbf4ef5998e655179c74c107713a29e36a7 Mon Sep 17 00:00:00 2001 From: Ben Woo <30431861+benwoo1110@users.noreply.github.com> Date: Fri, 10 Feb 2023 17:11:05 +0800 Subject: [PATCH] refactor: Use better nesting for locales key --- .../commands/CreateCommand.java | 8 ++-- .../MultiverseCore/commands/DebugCommand.java | 10 ++--- .../MultiverseCore/locale/MVCorei18n.java | 2 +- .../resources/multiverse-core_en.properties | 42 +++++++++---------- 4 files changed, 31 insertions(+), 31 deletions(-) diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java index e3cd56eb..d8af8420 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/CreateCommand.java @@ -81,21 +81,21 @@ public class CreateCommand extends MultiverseCommand { @CommandPermission("multiverse.core.create") @CommandCompletion("@empty @flags:groupName=mvcreate") @Syntax(" --seed [seed] --generator [generator[:id]] --world-type [worldtype] --adjust-spawn --no-structures") - @Description("{@@mv-core.create_description}") + @Description("{@@mv-core.create.description}") public void onCreateCommand(BukkitCommandIssuer issuer, @Conditions("validWorldName:scope=new") @Syntax("") - @Description("{@@mv-core.create_name_description}") + @Description("{@@mv-core.create.name.description}") String worldName, @Syntax("") - @Description("{@@mv-core.create_environment_description}") + @Description("{@@mv-core.create.environment.description}") World.Environment environment, @Optional @Syntax("--seed [seed] --generator [generator[:id]] --world-type [worldtype] --adjust-spawn --no-structures") - @Description("{@@mv-core.create_flags_description}") + @Description("{@@mv-core.create.flags.description}") String[] flags ) { ParsedCommandFlags parsedFlags = parseFlags(flags); diff --git a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java index 17ba9b5a..30df1220 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java +++ b/src/main/java/com/onarandombox/MultiverseCore/commands/DebugCommand.java @@ -20,7 +20,7 @@ public class DebugCommand extends MultiverseCommand { @Subcommand("debug") @CommandPermission("multiverse.core.debug") - @Description("{@@mv-core.debug_info_description}") + @Description("{@@mv-core.debug.info.description}") public void onShowDebugCommand(BukkitCommandIssuer issuer) { this.displayDebugMode(issuer); } @@ -28,12 +28,12 @@ public class DebugCommand extends MultiverseCommand { @Subcommand("debug") @CommandPermission("multiverse.core.debug") @CommandCompletion("@range:3") - @Syntax("<{@@mv-core.debug_change_syntax}>") - @Description("{@@mv-core.debug_change_description}") + @Syntax("<{@@mv-core.debug.change.syntax}>") + @Description("{@@mv-core.debug.change.description}") public void onChangeDebugCommand(BukkitCommandIssuer issuer, - @Syntax("<{@@mv-core.debug_change_syntax}>") - @Description("{@@mv-core.debug_change_level_description}") + @Syntax("<{@@mv-core.debug.change.syntax}>") + @Description("{@@mv-core.debug.change.level.description}") int level) { this.plugin.getMVConfig().setGlobalDebug(level); diff --git a/src/main/java/com/onarandombox/MultiverseCore/locale/MVCorei18n.java b/src/main/java/com/onarandombox/MultiverseCore/locale/MVCorei18n.java index 8cc93b75..dab78959 100644 --- a/src/main/java/com/onarandombox/MultiverseCore/locale/MVCorei18n.java +++ b/src/main/java/com/onarandombox/MultiverseCore/locale/MVCorei18n.java @@ -20,7 +20,7 @@ public enum MVCorei18n implements MessageKeyProvider { DEBUG_INFO_OFF, DEBUG_INFO_ON; - private final MessageKey key = MessageKey.of("mv-core." + this.name().toLowerCase()); + private final MessageKey key = MessageKey.of("mv-core." + this.name().replace('_', '.').toLowerCase()); @Override public MessageKey getMessageKey() { diff --git a/src/main/resources/multiverse-core_en.properties b/src/main/resources/multiverse-core_en.properties index e4e2a381..dc28fe11 100644 --- a/src/main/resources/multiverse-core_en.properties +++ b/src/main/resources/multiverse-core_en.properties @@ -1,23 +1,23 @@ -mv-core.config_save_failed=§cUnable to save Multiverse-Core config.yml. Your changes will be temporary! +mv-core.config.save.failed=§cUnable to save Multiverse-Core config.yml. Your changes will be temporary! -mv-core.create_description=Creates a new world and loads it. -mv-core.create_name_description=New world name. -mv-core.create_environment_description=The world's environment. See: /mv environments -mv-core.create_flags_description=Additional world settings. See http://gg.gg/nn8bl for all possible flags. -mv-core.create_properties=Creating world {worldName} with the following properties: -mv-core.create_properties_environment=- Environment: {environment} -mv-core.create_properties_seed=- Seed: {seed} -mv-core.create_properties_worldtype=- World Type: {worldType} -mv-core.create_properties_adjustspawn=- Adjust Spawn: {adjustSpawn} -mv-core.create_properties_generator=- Generator: {generator} -mv-core.create_properties_structures=- Structures: {structures} -mv-core.create_loading=Creating world... -mv-core.create_failed=§cFailed to create world '{worldName}'! See console for details. -mv-core.create_success=§aWorld '{worldName}' created successfully! +mv-core.create.description=Creates a new world and loads it. +mv-core.create.name.description=New world name. +mv-core.create.environment.description=The world's environment. See: /mv environments +mv-core.create.flags.description=Additional world settings. See http://gg.gg/nn8bl for all possible flags. +mv-core.create.properties=Creating world {worldName} with the following properties: +mv-core.create.properties.environment=- Environment: {environment} +mv-core.create.properties.seed=- Seed: {seed} +mv-core.create.properties.worldtype=- World Type: {worldType} +mv-core.create.properties.adjustspawn=- Adjust Spawn: {adjustSpawn} +mv-core.create.properties.generator=- Generator: {generator} +mv-core.create.properties.structures=- Structures: {structures} +mv-core.create.loading=Creating world... +mv-core.create.failed=§cFailed to create world '{worldName}'! See console for details. +mv-core.create.success=§aWorld '{worldName}' created successfully! -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. -mv-core.debug_change_description=Change debug level. -mv-core.debug_change_syntax=level -mv-core.debug_change_level_description=Debug level to set to. +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. +mv-core.debug.change.description=Change debug level. +mv-core.debug.change.syntax=level +mv-core.debug.change.level.description=Debug level to set to.