Make the plot jukebox gui translatable

Fixes https://github.com/IntellectualSites/PlotSquared-Translations/issues/2
This commit is contained in:
NotMyFault 2021-05-13 20:21:19 +02:00
parent 9344e1ca79
commit 3d7c191d1c
No known key found for this signature in database
GPG Key ID: 158F5701A6AAD00C
2 changed files with 9 additions and 5 deletions

View File

@ -85,7 +85,7 @@ public class Music extends SubCommand {
); );
return true; 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 @Override
public boolean onClick(int index) { public boolean onClick(int index) {
PlotItemStack item = getItem(index); PlotItemStack item = getItem(index);
@ -132,15 +132,15 @@ public class Music extends SubCommand {
for (final String disc : DISCS) { for (final String disc : DISCS) {
final String name = String.format("<gold>%s</gold>", disc); final String name = String.format("<gold>%s</gold>", disc);
final String[] lore = {"<green>Click to play!</green>"}; final String[] lore = {TranslatableCaption.of("plotjukebox.click_to_play").getComponent(player)};
final PlotItemStack item = new PlotItemStack(disc, 1, name, lore); final PlotItemStack item = new PlotItemStack(disc, 1, name, lore);
inv.setItem(index++, item); inv.setItem(index++, item);
} }
// Always add the cancel button // Always add the cancel button
// if (player.getMeta("music") != null) { // if (player.getMeta("music") != null) {
String name = "<gold>Cancel music</gold>"; String name = TranslatableCaption.of("plotjukebox.cancel_music").getComponent(player);
String[] lore = {"<red>Click to remove the music!<reset>"}; String[] lore = {TranslatableCaption.of("plotjukebox.reset_music").getComponent(player)};
inv.setItem(index, new PlotItemStack("bedrock", 1, name, lore)); inv.setItem(index, new PlotItemStack("bedrock", 1, name, lore));
// } // }

View File

@ -670,5 +670,9 @@
"commands.description.trust": "<gray>Allow a user to build in a plot and use WorldEdit while the plot owner is offline.</gray>", "commands.description.trust": "<gray>Allow a user to build in a plot and use WorldEdit while the plot owner is offline.</gray>",
"commands.description.unlink": "<gray>Unlink a mega-plot.</gray>", "commands.description.unlink": "<gray>Unlink a mega-plot.</gray>",
"commands.description.visit": "<gray>Visit someones plot.</gray>", "commands.description.visit": "<gray>Visit someones plot.</gray>",
"commands.description.weanywhere": "<gray>Force bypass of WorldEdit restrictions.</gray>" "commands.description.weanywhere": "<gray>Force bypass of WorldEdit restrictions.</gray>",
"plotjukebox.jukebox_header": "Plot Jukebox",
"plotjukebox.click_to_play": "<green>Click to play!</green>",
"plotjukebox.cancel_music": "<gold>Cancel music</gold>",
"plotjukebox.reset_music": "<red>Click to remove the music!</red>"
} }