From c73f6ede90cd7776e4621e96b7f26bfd38ed67fc Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 15 Jul 2021 00:11:20 +0300 Subject: [PATCH] Add a locale to allow users to customise the display of the command list Signed-off-by: BuildTools --- .../me/william278/huskhomes2/commands/HuskHomesCommand.java | 4 ++-- src/main/resources/Languages/en-gb.yml | 1 + src/main/resources/Languages/it-it.yml | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java b/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java index ca8b7ff4..f1b4ad13 100644 --- a/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java +++ b/src/main/java/me/william278/huskhomes2/commands/HuskHomesCommand.java @@ -45,9 +45,9 @@ public class HuskHomesCommand extends CommandBase implements TabCompleter { if (command.equals("huskhomes") && HuskHomes.getSettings().hideHuskHomesCommandFromHelpMenu()) { continue; } - String description = (String) plugin.getDescription().getCommands().get(command).get("description"); + String commandDescription = (String) plugin.getDescription().getCommands().get(command).get("description"); String commandUsage = (String) plugin.getDescription().getCommands().get(command).get("usage"); - commandDisplay.add("[/" + command + "](#00fb9a show_text=�fb9a&" + commandUsage + " suggest_command=/" + command + ") [•](white) [" + description + "](gray)"); + commandDisplay.add(MessageManager.getRawMessage("command_list_item", command, commandUsage, commandDescription)); } MessageManager.sendMessage(player, "command_list_header"); diff --git a/src/main/resources/Languages/en-gb.yml b/src/main/resources/Languages/en-gb.yml index aac411ed..6e976303 100644 --- a/src/main/resources/Languages/en-gb.yml +++ b/src/main/resources/Languages/en-gb.yml @@ -105,6 +105,7 @@ page_options_min_max: '\n[Viewing Page %1%/%2%](#00fb9a)' page_options_max: '\n[←](gray show_text=&7View previous page run_command=%1%) [Viewing Page %2%/%3%](#00fb9a)' page_no_items: '[(No items to display on this page)](gray show_text=&7Try a different page number)' command_list_header: '\n[HuskHomes](#00fb9a bold) [| Command List](#00fb9a)' +command_list_item: '[/%1%](#00fb9a show_text=�fb9a&%2% suggest_command=/%1%) [•](white) [%3%](gray)' error_invalid_on_arrival: '[Error:](#ff3300) [Failed to finish your teleportation as the target world could not be found.](#ff7e5e)' tpignore_toggle_on: '[You are now](#00fb9a) [ignoring](#00fb9a bold) [incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to listen for incoming teleport requests run_command=/huskhomes:tpignore)' tpignore_toggle_off: '[You are now](#00fb9a) [listening](#00fb9a bold) [to any incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to ignore incoming teleport requests run_command=/huskhomes:tpignore)' diff --git a/src/main/resources/Languages/it-it.yml b/src/main/resources/Languages/it-it.yml index a612cbf6..6f8abbe4 100644 --- a/src/main/resources/Languages/it-it.yml +++ b/src/main/resources/Languages/it-it.yml @@ -105,6 +105,7 @@ page_options_min_max: '\n[Pagina %1%/%2%](#00fb9a)' page_options_max: '\n[←](gray show_text=&7Pagina precedente run_command=%1%) [Pagina %2%/%3%](#00fb9a)' page_no_items: '[(Nessun oggetto visibile in questa pagina)](gray show_text=&7Prova un numero differente)' command_list_header: '\n[HuskHomes](#00fb9a bold) [| Comandi](#00fb9a)' +command_list_item: '[/%1%](#00fb9a show_text=�fb9a&%2% suggest_command=/%1%) [•](white) [%3%](gray)' error_invalid_on_arrival: '[Errore:](#ff3300) [Non sono riuscito a teletrasportarti perché il mondo non è caricato correttamente.](#ff7e5e)' tpignore_toggle_on: '[You are now](#00fb9a) [ignoring](#00fb9a bold) [incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to listen for incoming teleport requests run_command=/huskhomes:tpignore)' tpignore_toggle_off: '[You are now](#00fb9a) [listening](#00fb9a bold) [to any incoming teleport requests.](#00fb9a) [(Click to toggle)](gray show_text=&7Click to ignore incoming teleport requests run_command=/huskhomes:tpignore)'