From 214d6103b731f48b3ab57f0d64989277807c44ba Mon Sep 17 00:00:00 2001 From: Vexatos Date: Sun, 17 Aug 2014 19:05:49 +0200 Subject: [PATCH 1/2] Added backpack and command localization. Saplings and Butterflies take a lot longer to localize. Cannot do this today. Maybe someone else will do it. --- .../apiculture/CommandBeekeepingMode.java | 12 +++++----- .../arboriculture/CommandTreekeepingMode.java | 12 +++++----- .../java/forestry/core/CommandForestry.java | 11 +++++---- src/main/java/forestry/mail/CommandMail.java | 8 +++---- .../forestry/storage/items/ItemBackpack.java | 6 ++--- .../resources/assets/forestry/lang/en_US.lang | 24 +++++++++++++++++++ 6 files changed, 49 insertions(+), 24 deletions(-) diff --git a/src/main/java/forestry/apiculture/CommandBeekeepingMode.java b/src/main/java/forestry/apiculture/CommandBeekeepingMode.java index bb24132cd..8820a97e2 100755 --- a/src/main/java/forestry/apiculture/CommandBeekeepingMode.java +++ b/src/main/java/forestry/apiculture/CommandBeekeepingMode.java @@ -104,12 +104,12 @@ public class CommandBeekeepingMode extends CommandMC { saveStatistics(sender, arguments); } else if (arguments[0].matches("help")) { - sendChatMessage(sender, "Format: '/" + this.getCommandName() + " '"); - sendChatMessage(sender, "Available commands:"); - sendChatMessage(sender, "- list []: lists current and available beekeeping modes."); - sendChatMessage(sender, "- info : information on beekeeping mode."); - sendChatMessage(sender, "- set [] : set beekeeping mode for world."); - sendChatMessage(sender, "- save [] : save beekeeping statistics for the given player."); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.bees.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.3")); + sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.4")); + sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.5")); } } diff --git a/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java b/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java index 6e770a585..cd239294c 100755 --- a/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java +++ b/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java @@ -104,12 +104,12 @@ public class CommandTreekeepingMode extends CommandMC { saveStatistics(sender, arguments); } else if (arguments[0].matches("help")) { - sendChatMessage(sender, "Format: '/" + this.getCommandName() + " '"); - sendChatMessage(sender, "Available commands:"); - sendChatMessage(sender, "- list []: lists current and available treekeeping modes."); - sendChatMessage(sender, "- info : information on treekeeping mode."); - sendChatMessage(sender, "- set [] : set treekeeping mode for world."); - sendChatMessage(sender, "- save [] : save treekeeping statistics for the given player."); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.trees.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.3")); + sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.4")); + sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.5")); } } diff --git a/src/main/java/forestry/core/CommandForestry.java b/src/main/java/forestry/core/CommandForestry.java index 554e570ae..97204f8b8 100755 --- a/src/main/java/forestry/core/CommandForestry.java +++ b/src/main/java/forestry/core/CommandForestry.java @@ -12,6 +12,7 @@ package forestry.core; import java.util.List; +import forestry.core.utils.StringUtil; import net.minecraft.command.CommandException; import net.minecraft.command.ICommand; import net.minecraft.command.ICommandSender; @@ -61,11 +62,11 @@ public class CommandForestry extends CommandMC { commandPlugins(sender, arguments); return; } else if (arguments[0].matches("help")) { - sendChatMessage(sender, "Format: '" + this.getCommandName() + " '"); - sendChatMessage(sender, "Available commands:"); - sendChatMessage(sender, "- version : Version information."); - sendChatMessage(sender, "- plugins : list of Forestry plugins."); - sendChatMessage(sender, "- plugins info : information on plugin."); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.command.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.command.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.command.help.3")); + sendChatMessage(sender, StringUtil.localize("chat.command.help.4")); return; } diff --git a/src/main/java/forestry/mail/CommandMail.java b/src/main/java/forestry/mail/CommandMail.java index 7e5e7ecb2..9f2aeceee 100755 --- a/src/main/java/forestry/mail/CommandMail.java +++ b/src/main/java/forestry/mail/CommandMail.java @@ -65,10 +65,10 @@ public class CommandMail extends CommandMC { commandVirtualize(sender, arguments); return; } else if (arguments[0].matches("help")) { - sendChatMessage(sender, "Format: '" + this.getCommandName() + " '"); - sendChatMessage(sender, "Available commands:"); - sendChatMessage(sender, "- trades : A list of all trade stations."); - sendChatMessage(sender, "- virtualize : Toggle virtual mode on specified trade station."); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.mail.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.command.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.command.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.command.help.3")); return; } diff --git a/src/main/java/forestry/storage/items/ItemBackpack.java b/src/main/java/forestry/storage/items/ItemBackpack.java index ef6b46e9f..0e2f312d8 100755 --- a/src/main/java/forestry/storage/items/ItemBackpack.java +++ b/src/main/java/forestry/storage/items/ItemBackpack.java @@ -240,11 +240,11 @@ public class ItemBackpack extends ItemInventoried { BackpackMode mode = getMode(itemstack); if (mode == BackpackMode.LOCKED) - list.add("(LOCKED)"); + list.add(StringUtil.localize("storage.backpack.mode.locked")); else if (mode == BackpackMode.RECEIVE) - list.add("(RECEIVING)"); + list.add(StringUtil.localize("storage.backpack.mode.receiving")); else if (mode == BackpackMode.RESUPPLY) - list.add("(RESUPPLY)"); + list.add(StringUtil.localize("storage.backpack.mode.resupply")); list.add(occupied + "/" + getBackpackSize() + " " + StringUtil.localize("gui.slots")); } diff --git a/src/main/resources/assets/forestry/lang/en_US.lang b/src/main/resources/assets/forestry/lang/en_US.lang index 25ad02e25..c03f77771 100644 --- a/src/main/resources/assets/forestry/lang/en_US.lang +++ b/src/main/resources/assets/forestry/lang/en_US.lang @@ -473,6 +473,9 @@ storage.backpack.forester=Forester's Backpack storage.backpack.hunter=Hunter's Backpack storage.backpack.miner=Miner's Backpack storage.backpack.t2adj=Woven +storage.backpack.mode.locked=(LOCKED) +storage.backpack.mode.receiving=(RECEIVING) +storage.backpack.mode.resupply=(RESUPPLY) tile.for.engine.0=Electrical Engine tile.for.engine.1=Peat-fired Engine tile.for.engine.2=Biogas Engine @@ -538,6 +541,11 @@ trigger.lowInput=Input trigger.lowStamps=Stamps trigger.mailBuffer=Buffer usage.engine.tin=In Electrical Engines +chat.command.help.0=Format: '/%s ' +chat.command.help.1=Available commands: +chat.command.help.2=- version : Version information. +chat.command.help.3=- plugins : list of Forestry plugins. +chat.command.help.4=- plugins info : information on plugin. #################### # APICULTURE @@ -704,6 +712,12 @@ tile.stump.0=Candle Stump tile.for.apiculture.0=Apiary tile.for.apiculture.1=Apiarist's Chest tile.for.apiculture.2=Bee House +chat.command.bees.help.0=Format: '/%s ' +chat.command.bees.help.1=Available commands: +chat.command.bees.help.2=- list []: lists current and available beekeeping modes. +chat.command.bees.help.3=- info : information on beekeeping mode. +chat.command.bees.help.4=- set [] : set beekeeping mode for world. +chat.command.bees.help.5=- save [] : save beekeeping statistics for the given player. #################### # ARBORICULTURE @@ -869,6 +883,12 @@ tile.for.stairs.21=Plum Stairs tile.for.stairs.22=Maple Stairs tile.for.stairs.23=Citrus Stairs tile.for.arboriculture.0=Arborist's Chest +chat.command.trees.help.0=Format: '/%s ' +chat.command.trees.help.1=Available commands: +chat.command.trees.help.2=- list []: lists current and available treekeeping modes. +chat.command.trees.help.3=- info : information on treekeeping mode. +chat.command.trees.help.4=- set [] : set treekeeping mode for world. +chat.command.trees.help.5=- save [] : save treekeeping statistics for the given player. #################### # FARMING @@ -970,6 +990,10 @@ gui.mail.address.copy=Use gui.mail.tradefor=for gui.mail.notrades=No trades available. item.catalogue=Catalogue +chat.command.mail.help.0=Format: '/%s ' +chat.command.mail.help.1=Available commands: +chat.command.mail.help.2=- trades : A list of all trade stations. +chat.command.mail.help.3=- virtualize : Toggle virtual mode on specified trade station. #################### # PIPES From ebdce508f1d2c0b5464b8dfa454a38388dad8a5c Mon Sep 17 00:00:00 2001 From: Vexatos Date: Sun, 17 Aug 2014 19:13:54 +0200 Subject: [PATCH 2/2] Properly sorted by alphabet --- .../apiculture/CommandBeekeepingMode.java | 12 +++--- .../arboriculture/CommandTreekeepingMode.java | 12 +++--- src/main/java/forestry/mail/CommandMail.java | 8 ++-- .../resources/assets/forestry/lang/en_US.lang | 42 +++++++++---------- 4 files changed, 37 insertions(+), 37 deletions(-) diff --git a/src/main/java/forestry/apiculture/CommandBeekeepingMode.java b/src/main/java/forestry/apiculture/CommandBeekeepingMode.java index 8820a97e2..4e032d271 100755 --- a/src/main/java/forestry/apiculture/CommandBeekeepingMode.java +++ b/src/main/java/forestry/apiculture/CommandBeekeepingMode.java @@ -104,12 +104,12 @@ public class CommandBeekeepingMode extends CommandMC { saveStatistics(sender, arguments); } else if (arguments[0].matches("help")) { - sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.bees.help.0", this.getCommandName())); - sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.1")); - sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.2")); - sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.3")); - sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.4")); - sendChatMessage(sender, StringUtil.localize("chat.command.bees.help.5")); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.bees.command.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.3")); + sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.4")); + sendChatMessage(sender, StringUtil.localize("chat.bees.command.help.5")); } } diff --git a/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java b/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java index cd239294c..11291667e 100755 --- a/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java +++ b/src/main/java/forestry/arboriculture/CommandTreekeepingMode.java @@ -104,12 +104,12 @@ public class CommandTreekeepingMode extends CommandMC { saveStatistics(sender, arguments); } else if (arguments[0].matches("help")) { - sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.trees.help.0", this.getCommandName())); - sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.1")); - sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.2")); - sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.3")); - sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.4")); - sendChatMessage(sender, StringUtil.localize("chat.command.trees.help.5")); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.trees.command.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.3")); + sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.4")); + sendChatMessage(sender, StringUtil.localize("chat.trees.command.help.5")); } } diff --git a/src/main/java/forestry/mail/CommandMail.java b/src/main/java/forestry/mail/CommandMail.java index 9f2aeceee..8f5689e57 100755 --- a/src/main/java/forestry/mail/CommandMail.java +++ b/src/main/java/forestry/mail/CommandMail.java @@ -65,10 +65,10 @@ public class CommandMail extends CommandMC { commandVirtualize(sender, arguments); return; } else if (arguments[0].matches("help")) { - sendChatMessage(sender, StringUtil.localizeAndFormat("chat.command.mail.help.0", this.getCommandName())); - sendChatMessage(sender, StringUtil.localize("chat.command.help.1")); - sendChatMessage(sender, StringUtil.localize("chat.command.help.2")); - sendChatMessage(sender, StringUtil.localize("chat.command.help.3")); + sendChatMessage(sender, StringUtil.localizeAndFormat("chat.mail.command.help.0", this.getCommandName())); + sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.1")); + sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.2")); + sendChatMessage(sender, StringUtil.localize("chat.mail.command.help.3")); return; } diff --git a/src/main/resources/assets/forestry/lang/en_US.lang b/src/main/resources/assets/forestry/lang/en_US.lang index c03f77771..6daaa7bb9 100644 --- a/src/main/resources/assets/forestry/lang/en_US.lang +++ b/src/main/resources/assets/forestry/lang/en_US.lang @@ -9,6 +9,11 @@ beverage.effect.antidote=Antidote chat.accesslocked=is the owner of this machine and has locked access. chat.memorizednote=You memorize the note and dispose of the crumpled scrap of paper. chat.cannotmemorizeagain=You already memorized this information. +chat.command.help.0=Format: '/%s ' +chat.command.help.1=Available commands: +chat.command.help.2=- version : Version information. +chat.command.help.3=- plugins : list of Forestry plugins. +chat.command.help.4=- plugins info : information on plugin. circuit.dampener.1=Fire Dampener circuit.electric.choke.1=Electric Choke circuit.electric.efficiency.1=Electric Efficiency @@ -541,11 +546,6 @@ trigger.lowInput=Input trigger.lowStamps=Stamps trigger.mailBuffer=Buffer usage.engine.tin=In Electrical Engines -chat.command.help.0=Format: '/%s ' -chat.command.help.1=Available commands: -chat.command.help.2=- version : Version information. -chat.command.help.3=- plugins : list of Forestry plugins. -chat.command.help.4=- plugins info : information on plugin. #################### # APICULTURE @@ -647,6 +647,12 @@ beemode.normal.desc=Recommended mode for the normal player. beemode.hard.desc=Reducing mutation rate slightly while increasing lifespan of individual queens by 50 %. beemode.hardcore.desc=Halves mutation rate, increases lifespan of individual queens by 500 % and reduces fertility by 20 %. beemode.insane.desc=Cuts mutation rate to 20 %, increases lifespan tenfold and reduces fertility by 40 %. +chat.bees.command.help.0=Format: '/%s ' +chat.bees.command.help.1=Available commands: +chat.bees.command.help.2=- list []: lists current and available beekeeping modes. +chat.bees.command.help.3=- info : information on beekeeping mode. +chat.bees.command.help.4=- set [] : set beekeeping mode for world. +chat.bees.command.help.5=- save [] : save beekeeping statistics for the given player. description.speciesForest=One of the most common pests in forests; Mostly docile.|Beekeeping 101 description.speciesMeadows=Infests mostly plains in temperate climates; Mostly docile.|Beekeeping 101 description.speciesCommon=Considered the beginner apiarist's badge of participation.|Beekeeping 101 @@ -712,17 +718,17 @@ tile.stump.0=Candle Stump tile.for.apiculture.0=Apiary tile.for.apiculture.1=Apiarist's Chest tile.for.apiculture.2=Bee House -chat.command.bees.help.0=Format: '/%s ' -chat.command.bees.help.1=Available commands: -chat.command.bees.help.2=- list []: lists current and available beekeeping modes. -chat.command.bees.help.3=- info : information on beekeeping mode. -chat.command.bees.help.4=- set [] : set beekeeping mode for world. -chat.command.bees.help.5=- save [] : save beekeeping statistics for the given player. #################### # ARBORICULTURE #################### +chat.trees.command.help.0=Format: '/%s ' +chat.trees.command.help.1=Available commands: +chat.trees.command.help.2=- list []: lists current and available treekeeping modes. +chat.trees.command.help.3=- info : information on treekeeping mode. +chat.trees.command.help.4=- set [] : set treekeeping mode for world. +chat.trees.command.help.5=- save [] : save treekeeping statistics for the given player. gui.maturity=Matures gui.treealyzer=Treealyzer gui.treealyzer.help=Supply sapling and provide honey or honeydew as catalyst. @@ -883,12 +889,6 @@ tile.for.stairs.21=Plum Stairs tile.for.stairs.22=Maple Stairs tile.for.stairs.23=Citrus Stairs tile.for.arboriculture.0=Arborist's Chest -chat.command.trees.help.0=Format: '/%s ' -chat.command.trees.help.1=Available commands: -chat.command.trees.help.2=- list []: lists current and available treekeeping modes. -chat.command.trees.help.3=- info : information on treekeeping mode. -chat.command.trees.help.4=- set [] : set treekeeping mode for world. -chat.command.trees.help.5=- save [] : save treekeeping statistics for the given player. #################### # FARMING @@ -967,6 +967,10 @@ tile.for.lepidopterology.0=Lepidopterist's Chest # MAIL #################### +chat.mail.command.help.0=Format: '/%s ' +chat.mail.command.help.1=Available commands: +chat.mail.command.help.2=- trades : A list of all trade stations. +chat.mail.command.help.3=- virtualize : Toggle virtual mode on specified trade station. chat.mail.no_mailbox=Recipient has no mailbox. chat.mail.not_mailable=Letter is not sendable. chat.mail.not_postpaid=Letter is not sufficiently stamped. @@ -990,10 +994,6 @@ gui.mail.address.copy=Use gui.mail.tradefor=for gui.mail.notrades=No trades available. item.catalogue=Catalogue -chat.command.mail.help.0=Format: '/%s ' -chat.command.mail.help.1=Available commands: -chat.command.mail.help.2=- trades : A list of all trade stations. -chat.command.mail.help.3=- virtualize : Toggle virtual mode on specified trade station. #################### # PIPES