From 4d3603bcc7d62c0013eced5634f24c8f3ee68f45 Mon Sep 17 00:00:00 2001 From: James Peters Date: Sat, 24 Oct 2020 22:56:21 +0100 Subject: [PATCH] Lang Updates --- .../minecraft/chests/lang/Message.java | 18 ++++++++++++++++- .../minecraft/chests/menus/PartyMenu.java | 20 +++++++++---------- .../src/main/resources/lang/en_GB.properties | 12 +++++++++++ 3 files changed, 39 insertions(+), 11 deletions(-) diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/lang/Message.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/lang/Message.java index b83b0ea..bd60318 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/lang/Message.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/lang/Message.java @@ -79,7 +79,23 @@ public enum Message { PARTY_INVITE_OWNER("You have invited {0} to join your party: {1}", Tag.PLAYER_NAME, Tag.PARTY_NAME), PARTY_JOINED("You have joined {0}''s party: {1}", Tag.PLAYER_NAME, Tag.PARTY_NAME), PARTY_NO_INVITE("You currently have no pending party invites!"), - PARTY_ACCEPT_INVITE("Click Here to accept the invite!"); + PARTY_ACCEPT_INVITE("Click Here to accept the invite!"), + + PARTY_ENTER_NAME("Enter a Party Name"), + ALREADY_EXISTS_ANVIL("Already exists!"), + PARTY_INVITE_PLAYER("Choose a player to invite!"), + PARTY_REMOVE_PLAYER("Choose a player to remove!"), + PARTY_REMOVE_PLAYER_DIALOG("Remove player \"{0}\" ?", Tag.PLAYER_NAME), + PARTY_MEMBERS("{0} members", Tag.PARTY_NAME), + PARTY_OWNER("Owner"), + PARTY_DELETE("Delete party \"{0}\"?", Tag.PARTY_NAME), + PARTY_JOIN("Join {0}'s party \"{1}\"", Tag.PLAYER_NAME, Tag.PARTY_NAME), + PARTY_LEAVE("Leave party: {0}?", Tag.PARTY_NAME), + + YES("Yes"), + NO("No"), + + ; String message; diff --git a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/menus/PartyMenu.java b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/menus/PartyMenu.java index 5592042..7768bf8 100644 --- a/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/menus/PartyMenu.java +++ b/ChestsPlusPlus_Main/src/main/java/com/jamesdpeters/minecraft/chests/menus/PartyMenu.java @@ -130,7 +130,7 @@ public class PartyMenu implements InventoryProvider { */ public void create(Player player) { - TextInputUI.getInput(player, "Enter a Party Name", (p, partyName) -> { + TextInputUI.getInput(player, Message.PARTY_ENTER_NAME.getString(), (p, partyName) -> { boolean result = PartyUtils.createParty(player, partyName); if (result){ player.sendMessage(ChatColor.GREEN+ Message.PARTY_CREATED.getString(ChatColor.WHITE+partyName+ChatColor.GREEN)); @@ -138,7 +138,7 @@ public class PartyMenu implements InventoryProvider { return AnvilGUI.Response.close(); } else { player.sendMessage(ChatColor.RED+Message.PARTY_ALREADY_EXISTS.getString(ChatColor.WHITE+partyName+ChatColor.RED)); - return AnvilGUI.Response.text("Already exists!"); + return AnvilGUI.Response.text(Message.ALREADY_EXISTS_ANVIL.getString()); } }); } @@ -147,7 +147,7 @@ public class PartyMenu implements InventoryProvider { PartySelectorMenu.open(player, getMenu(), PartySelectorMenu.Type.OWNED, (party, menu) -> { List inviteablePlayers = Utils.getOnlinePlayersNotInList(party.getMembers()); inviteablePlayers.remove(party.getOwner()); - PlayerSelectorMenu.open(player, "Choose a player to invite!", menu, inviteablePlayers, (player1, itemStack) -> itemStack, (playerToInvite, menu2) -> { + PlayerSelectorMenu.open(player, Message.PARTY_INVITE_PLAYER.getString(), menu, inviteablePlayers, (player1, itemStack) -> itemStack, (playerToInvite, menu2) -> { PartyUtils.invitePlayer(party, playerToInvite); getMenu().open(player); }); @@ -156,8 +156,8 @@ public class PartyMenu implements InventoryProvider { public void removePlayer(Player player) { PartySelectorMenu.open(player, getMenu(), PartySelectorMenu.Type.OWNED, (party, menu) -> { - PlayerSelectorMenu.open(player, "Choose a player to remove!", menu, party.getMembers(), (player1, itemStack) -> itemStack, (selectedPlayer, menu2) -> { - AcceptDialogMenu.open(player, "Remove player \""+selectedPlayer.getName()+"\"?", "Yes", "No", aBoolean -> { + PlayerSelectorMenu.open(player, Message.PARTY_REMOVE_PLAYER.getString(), menu, party.getMembers(), (player1, itemStack) -> itemStack, (selectedPlayer, menu2) -> { + AcceptDialogMenu.open(player, Message.PARTY_REMOVE_PLAYER_DIALOG.getString(selectedPlayer.getName()), Message.YES.getString(), Message.NO.getString(), aBoolean -> { if (aBoolean) { party.removeMember(selectedPlayer); } @@ -169,10 +169,10 @@ public class PartyMenu implements InventoryProvider { public void listParties(Player player) { PartySelectorMenu.open(player, getMenu(), PartySelectorMenu.Type.ALL, (party, smartInventory) -> { - PlayerSelectorMenu.open(player, party.getPartyName()+" members", smartInventory, party.getAllPlayers(), + PlayerSelectorMenu.open(player, Message.PARTY_MEMBERS.getString(party.getPartyName()), smartInventory, party.getAllPlayers(), // Change player head to enchanted if owner. (offlinePlayer, itemStack) -> { - if (party.getOwner().getUniqueId().equals(offlinePlayer.getUniqueId())) return ItemBuilder.fromInstance(itemStack).addLore("Owner").get(); + if (party.getOwner().getUniqueId().equals(offlinePlayer.getUniqueId())) return ItemBuilder.fromInstance(itemStack).addLore(Message.PARTY_OWNER.getString()).get(); return itemStack; } , (playerSelected, smartInventory1) -> { @@ -183,7 +183,7 @@ public class PartyMenu implements InventoryProvider { public void deleteParty(Player player) { PartySelectorMenu.open(player, getMenu(), PartySelectorMenu.Type.OWNED, (party, smartInventory) -> { - AcceptDialogMenu.open(player, "Delete Party \""+party.getPartyName()+"\"?", "Yes", "No", aBoolean -> { + AcceptDialogMenu.open(player, Message.PARTY_DELETE.getString(party.getPartyName()), Message.YES.getString(), Message.NO.getString(), aBoolean -> { // If user accepts if (aBoolean) { boolean result = PartyUtils.deleteParty(party); @@ -204,7 +204,7 @@ public class PartyMenu implements InventoryProvider { public void partyInvites(Player player) { InvitesMenu.open(player, getMenu(), (invite, smartInventory) -> { - AcceptDialogMenu.open(player, "Join "+invite.getParty().getOwner().getName()+"'s party \""+invite.getParty().getPartyName()+"\"", "Yes", "No", aBoolean -> { + AcceptDialogMenu.open(player, Message.PARTY_JOIN.getString(invite.getParty().getOwner().getName(), invite.getParty().getPartyName()), Message.YES.getString(), Message.NO.getString(), aBoolean -> { if (aBoolean) { PartyUtils.acceptInvite(player, invite); getMenu().open(player); @@ -218,7 +218,7 @@ public class PartyMenu implements InventoryProvider { public void leaveParty(Player player) { PartySelectorMenu.open(player, getMenu(), PartySelectorMenu.Type.MEMBER_OF, (party, smartInventory) -> { - AcceptDialogMenu.open(player, "Leave party: "+party.getPartyName()+"?", "Yes", "No", aBoolean -> { + AcceptDialogMenu.open(player, Message.PARTY_LEAVE.getString(party.getPartyName()), Message.YES.getString(), Message.NO.getString(), aBoolean -> { if (aBoolean) { party.removeMember(player); } diff --git a/ChestsPlusPlus_Main/src/main/resources/lang/en_GB.properties b/ChestsPlusPlus_Main/src/main/resources/lang/en_GB.properties index f7e3887..9043729 100644 --- a/ChestsPlusPlus_Main/src/main/resources/lang/en_GB.properties +++ b/ChestsPlusPlus_Main/src/main/resources/lang/en_GB.properties @@ -4,35 +4,42 @@ # It should be located in the 'lang' folder # Then in config.yml 'language-file: default' would be renamed to 'language-file: en_US' # To help contribute to the plugin and provide new language files you can create a pull-request at https://github.com/JamesPeters98/ChestsPlusPlus or join our Discord https://discord.gg/YRs3mP5 +PARTY_ENTER_NAME=Enter a Party Name PARTY_CREATED=Party {party_name} has been created\! PARTY_DELETED=Party {party_name} has been deleted\! COMMAND_CHESTLINK_LIST=Lists all ChestLinks that you own\! +ALREADY_EXISTS_ANVIL=Already exists\! COMMAND_MEMBER=Add, remove or list members of a group COMMAND_AUTOCRAFT_LIST=Lists all AutoCraft groups that you own\! COMMAND_CHESTLINK_OPEN=Open the inventory of a ChestLink group MUST_LOOK_AT_CHEST=You must be looking at the chest you want to ChestLink\! COMMAND_AUTOCRAFT_OPEN=Open the workbench of an AutoCraft group ITEM_FRAME_FILTER_DEFAULT=ItemFrame is in default filtering mode. Rotate Item Frame to change mode\! +PARTY_REMOVE_PLAYER=Choose a player to remove\! ADDED_MEMBER_TO_ALL=Successfully added {player_name} to all {storage_type} groups INVALID_CHESTLINK=Invalid ChestLink - You must place a sign on the front of a chest / you should ensure there is space for a sign on front of the chest\! ADDED_MEMBER=Successfully added {player_name} to {storage_type} group {storage_identifier} LIST_OF_CHESTLINK=List of your ChestLinks\: OWNER_HAS_TOO_MANY_CHESTS=Owner\: {player_name} has reached the limit of groups allowed\! SORT=Sort method for {storage_identifier} has been set to {sort_method} +YES=Yes ITEM_FRAME_FILTER_DENY_ALL_TYPES=ItemFrame now prevents all types of this item from being accepted in the hopper\! e.g Enchanted Books. NO_PERMISSION=You don't have permission to do that\! COMMAND_CHESTLINK_SETPUBLIC=Set a ChestLink to be accessible by anyone. PARTY_NO_INVITE=You currently have no pending party invites\! CURRENT_MEMBERS=Current Members\: {player_list} CANNOT_RENAME_GROUP_DOESNT_EXIST=Error renaming group\! {storage_identifier} doesn't exist\! +PARTY_LEAVE=Leave party\: {party_name}? STORAGE_ADDED=Successfully added {storage_type} to group\: {storage_group} for {player_name} REMOVED_MEMBER=Successfully removed {player_name} from {storage_type} group {storage_identifier} REMOVED_GROUP=Successfully removed group {storage_group} from your {storage_type}'s\! LIST_OF_AUTOCRAFTERS=List of your AutoCraft Stations\: +PARTY_JOIN=Join {player_name}'s party "{party_name}" INVALID_AUTOCRAFTER=Invalid AutoCrafter - You must place a sign on any side of a Crafting Table, and it must not already by apart of a group\! ITEM_FRAME_FILTER_DENY=ItemFrame now prevents this item from being accepted in the hopper\! LIST_MEMBERS_OF_GROUP=Members of {storage_type} group {storage_identifier}\: {player_list} REMOVE_MEMBER_FROM_ALL=Successfully removed {player_name} from all {storage_type} groups +PARTY_INVITE_PLAYER=Choose a player to invite\! COMMAND_CHESTLINK_RENAME=Rename a ChestLink. STORAGE_REMOVED=Successfully removed {storage_type} from group\: {storage_group} for {player_name} PARTY_INVITE=You have been invited to join {player_name}''s party\: {party_name} @@ -49,16 +56,21 @@ PARTY_ALREADY_EXISTS=Party {party_name} already exists, unable to create it\! MUST_HOLD_SIGN=You must be holding a sign to do that\! COMMAND_CHESTLINK_ADD=Create/add a chest to a ChestLink group COMMAND_HELP=List of commands and their uses\! +NO=No UNABLE_TO_ADD_MEMBER_TO_ALL=Unable to add player {player_name} to {storage_type}\! PARTY_JOINED=You have joined {player_name}''s party\: {party_name} ITEM_FRAME_FILTER_ALL_TYPES=ItemFrame now filters all types of this item\! e.g Enchanted Books. +PARTY_DELETE=Delete party "{party_name}"? PARTY_INVITE_OWNER=You have invited {player_name} to join your party\: {party_name} COMMAND_AUTOCRAFT_RENAME=Rename an AutoCraft group. MUST_LOOK_AT_CRAFTING_TABLE=You must be looking at the Crafting Table you want to AutoCraft with\! COMMAND_AUTOCRAFT_REMOVE=Delete an AutoCraft group and drop all the Crafting Tables\! UNABLE_TO_REMOVE_MEMBER=Unable to remove player {player_name} from {storage_type}\! Were they already removed? +PARTY_REMOVE_PLAYER_DIALOG=Remove player "{player_name}" ? COMMAND_AUTOCRAFT_SETPUBLIC=Set an AutoCraft group to be accessible by anyone. +PARTY_OWNER=Owner ALREADY_PART_OF_GROUP=This {storage_type} is already a part of a group\! +PARTY_MEMBERS={party_name} members INVALID_ID=Invalid {storage_type} ID\! Must not contain a colon '\:' unless you are referencing another players group that you are a member of PARTY_ACCEPT_INVITE=Click Here to accept the invite\! FOUND_UNLINKED_STORAGE=This {storage_type} wasn't linked to your system\! It has been added under the {storage_identifier} group\!