From 3d7c191d1c32b38c7b56f699175503ec4d33fdd0 Mon Sep 17 00:00:00 2001 From: NotMyFault Date: Thu, 13 May 2021 20:21:19 +0200 Subject: [PATCH] Make the plot jukebox gui translatable Fixes https://github.com/IntellectualSites/PlotSquared-Translations/issues/2 --- .../src/main/java/com/plotsquared/core/command/Music.java | 8 ++++---- Core/src/main/resources/lang/messages_en.json | 6 +++++- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Music.java b/Core/src/main/java/com/plotsquared/core/command/Music.java index 6ab9250e3..bf91c6958 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Music.java +++ b/Core/src/main/java/com/plotsquared/core/command/Music.java @@ -85,7 +85,7 @@ public class Music extends SubCommand { ); return true; } - PlotInventory inv = new PlotInventory(this.inventoryUtil, player, 2, "Plot Jukebox") { + PlotInventory inv = new PlotInventory(this.inventoryUtil, player, 2, TranslatableCaption.of("plotjukebox.jukebox_header").getComponent(player)) { @Override public boolean onClick(int index) { PlotItemStack item = getItem(index); @@ -132,15 +132,15 @@ public class Music extends SubCommand { for (final String disc : DISCS) { final String name = String.format("%s", disc); - final String[] lore = {"Click to play!"}; + final String[] lore = {TranslatableCaption.of("plotjukebox.click_to_play").getComponent(player)}; final PlotItemStack item = new PlotItemStack(disc, 1, name, lore); inv.setItem(index++, item); } // Always add the cancel button // if (player.getMeta("music") != null) { - String name = "Cancel music"; - String[] lore = {"Click to remove the music!"}; + String name = TranslatableCaption.of("plotjukebox.cancel_music").getComponent(player); + String[] lore = {TranslatableCaption.of("plotjukebox.reset_music").getComponent(player)}; inv.setItem(index, new PlotItemStack("bedrock", 1, name, lore)); // } diff --git a/Core/src/main/resources/lang/messages_en.json b/Core/src/main/resources/lang/messages_en.json index b2563eb86..3e878a01b 100644 --- a/Core/src/main/resources/lang/messages_en.json +++ b/Core/src/main/resources/lang/messages_en.json @@ -670,5 +670,9 @@ "commands.description.trust": "Allow a user to build in a plot and use WorldEdit while the plot owner is offline.", "commands.description.unlink": "Unlink a mega-plot.", "commands.description.visit": "Visit someones plot.", - "commands.description.weanywhere": "Force bypass of WorldEdit restrictions." + "commands.description.weanywhere": "Force bypass of WorldEdit restrictions.", + "plotjukebox.jukebox_header": "Plot Jukebox", + "plotjukebox.click_to_play": "Click to play!", + "plotjukebox.cancel_music": "Cancel music", + "plotjukebox.reset_music": "Click to remove the music!" }