From 82cffd8c318c2c0bd2bde08bddcf982107728781 Mon Sep 17 00:00:00 2001 From: Eric Biedert Date: Fri, 24 Jun 2016 19:23:56 +0200 Subject: [PATCH] Fixed some localization errors --- lang/de_DE.lang | 7 ++++++- lang/en_US.lang | 2 +- src/de/epiceric/shopchest/ShopChest.java | 2 +- .../shopchest/config/LanguageConfiguration.java | 10 +++++++++- .../epiceric/shopchest/language/LanguageUtils.java | 12 ++++++------ 5 files changed, 23 insertions(+), 10 deletions(-) diff --git a/lang/de_DE.lang b/lang/de_DE.lang index 95b9a31..d24d8d8 100644 --- a/lang/de_DE.lang +++ b/lang/de_DE.lang @@ -1,4 +1,4 @@ -message.shop-created=&6Shop erstellt. +message.shop-created=&6Shop erstellt. message.chest-already-shop=&cTruhe ist bereits ein Shop. message.shop-removed=&6Shop entfernt. message.chest-no-shop=&cTruhe ist kein Shop. @@ -1113,6 +1113,7 @@ tile.blockGold.name=Goldblock tile.blockIron.name=Eisenblock tile.blockLapis.name=Lapislazuliblock tile.blockRedstone.name=Redstone-Block +tile.boneBlock.name=Knochenblock tile.bookshelf.name=Bücherregal tile.brick.name=Ziegelsteine tile.button.name=Knopf @@ -1246,6 +1247,7 @@ tile.log.jungle.name=Tropenholz tile.log.name=Holz tile.log.oak.name=Eichenholz tile.log.spruce.name=Fichtenholz +tile.magma.name=Magmablock tile.melon.name=Melone tile.mobSpawner.name=Monsterspawner tile.monsterStoneEgg.brick.name=Steinziegel (Silberfischchen) @@ -1262,6 +1264,7 @@ tile.netherBrick.name=Netherziegel tile.netherFence.name=Netherziegelzaun tile.netherStalk.name=Netherwarze tile.netherquartz.name=Netherquarzerz +tile.netherWartBlock.name=Netherwarzenblock tile.notGate.name=Redstone-Fackel tile.obsidian.name=Obsidian tile.oreCoal.name=Steinkohle @@ -1291,6 +1294,7 @@ tile.quartzBlock.default.name=Quarzblock tile.quartzBlock.lines.name=Quarzsäule tile.quartzBlock.name=Quarzblock tile.rail.name=Schiene +tile.redNetherBrick.name=Rote Netherziegel tile.redSandStone.chiseled.name=Gemeißelter roter Sandstein tile.redSandStone.default.name=Roter Sandstein tile.redSandStone.name=Roter Sandstein @@ -1376,6 +1380,7 @@ tile.stonebricksmooth.default.name=Steinziegel tile.stonebricksmooth.mossy.name=Bemooste Steinziegel tile.stonebricksmooth.name=Steinziegel tile.structureBlock.name=Konstruktionsblock +tile.structureVoid.name=Konstruktionsleere tile.tallgrass.fern.name=Farn tile.tallgrass.grass.name=Gras tile.tallgrass.name=Gras diff --git a/lang/en_US.lang b/lang/en_US.lang index aa39d1c..9665a76 100644 --- a/lang/en_US.lang +++ b/lang/en_US.lang @@ -16,7 +16,7 @@ message.shop-create-not-enough-money=&cNot enough money. You need &6%CREATION-PR # Set the vendor message the player gets after entering '/shop info'. # Usable regex: %VENDOR% -message.shopInfo.vendor=&6Vendor=&e%VENDOR% +message.shopInfo.vendor=&6Vendor: &e%VENDOR% # Set the product message the player gets after entering '/shop info'. # Usable regex: %AMOUNT%, %ITEMNAME% diff --git a/src/de/epiceric/shopchest/ShopChest.java b/src/de/epiceric/shopchest/ShopChest.java index eb4b7e7..2a0c5d0 100644 --- a/src/de/epiceric/shopchest/ShopChest.java +++ b/src/de/epiceric/shopchest/ShopChest.java @@ -68,7 +68,7 @@ public class ShopChest extends JavaPlugin { } private void initLanguageConfig() { - langConfig = new LanguageConfiguration(); + langConfig = new LanguageConfiguration(this); File langFolder = new File(getDataFolder(), "lang"); if (!(new File(langFolder, "en_US.lang")).exists()) diff --git a/src/de/epiceric/shopchest/config/LanguageConfiguration.java b/src/de/epiceric/shopchest/config/LanguageConfiguration.java index 7c5b321..6221387 100644 --- a/src/de/epiceric/shopchest/config/LanguageConfiguration.java +++ b/src/de/epiceric/shopchest/config/LanguageConfiguration.java @@ -1,5 +1,6 @@ package de.epiceric.shopchest.config; +import de.epiceric.shopchest.ShopChest; import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.file.FileConfiguration; @@ -13,6 +14,12 @@ public class LanguageConfiguration extends FileConfiguration { private ArrayList lines = new ArrayList<>(); private HashMap values = new HashMap<>(); + private ShopChest plugin; + + public LanguageConfiguration(ShopChest plugin) { + this.plugin = plugin; + } + @Override public String saveToString() { StringBuilder sb = new StringBuilder(""); @@ -33,6 +40,7 @@ public class LanguageConfiguration extends FileConfiguration { } } + plugin.getLogger().warning("Using default value for: " + path + " (" + def + ")"); return def; } @@ -67,7 +75,7 @@ public class LanguageConfiguration extends FileConfiguration { if (!line.startsWith("#")) { if (line.contains("=")) { - if (line.split("=").length == 2) { + if (line.split("=").length >= 2) { String key = line.split("=")[0]; StringBuilder sbValue = new StringBuilder(); diff --git a/src/de/epiceric/shopchest/language/LanguageUtils.java b/src/de/epiceric/shopchest/language/LanguageUtils.java index 929220c..212b324 100644 --- a/src/de/epiceric/shopchest/language/LanguageUtils.java +++ b/src/de/epiceric/shopchest/language/LanguageUtils.java @@ -81,9 +81,9 @@ public class LanguageUtils { itemNames.add(new ItemName(Material.LAPIS_ORE, langConfig.getString("tile.oreLapis.name", "Lapis Lazuli Ore"))); itemNames.add(new ItemName(Material.LAPIS_BLOCK, langConfig.getString("tile.blockLapis.name", "Lapis Lazuli Block"))); itemNames.add(new ItemName(Material.DISPENSER, langConfig.getString("tile.dispenser.name", "Dispenser"))); - itemNames.add(new ItemName(Material.SANDSTONE, langConfig.getString("tile.sandstone.default.name", "Sandstone"))); - itemNames.add(new ItemName(Material.SANDSTONE, 1, langConfig.getString("tile.sandstone.chiseled.name", "Chiseled Sandstone"))); - itemNames.add(new ItemName(Material.SANDSTONE, 2, langConfig.getString("tile.sandstone.smooth.name", "Smooth Sandstone"))); + itemNames.add(new ItemName(Material.SANDSTONE, langConfig.getString("tile.sandStone.default.name", "Sandstone"))); + itemNames.add(new ItemName(Material.SANDSTONE, 1, langConfig.getString("tile.sandStone.chiseled.name", "Chiseled Sandstone"))); + itemNames.add(new ItemName(Material.SANDSTONE, 2, langConfig.getString("tile.sandStone.smooth.name", "Smooth Sandstone"))); itemNames.add(new ItemName(Material.NOTE_BLOCK, langConfig.getString("tile.musicBlock.name", "Note Block"))); itemNames.add(new ItemName(Material.BED, langConfig.getString("tile.bed.name", "Bed"))); itemNames.add(new ItemName(Material.POWERED_RAIL, langConfig.getString("tile.goldenRail.name", "Powered Rail"))); @@ -611,7 +611,7 @@ public class LanguageUtils { enchantmentNames.add(new EnchantmentName(Enchantment.ARROW_KNOCKBACK, langConfig.getString("enchantment.arrowKnockback", "Punch"))); enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_ALL, langConfig.getString("enchantment.damage.all", "Sharpness"))); enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_ARTHROPODS, langConfig.getString("enchantment.damage.arthropods", "Bane of Arthropods"))); - enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_UNDEAD, langConfig.getString("enchantment.damange.undead", "Smite"))); + enchantmentNames.add(new EnchantmentName(Enchantment.DAMAGE_UNDEAD, langConfig.getString("enchantment.damage.undead", "Smite"))); enchantmentNames.add(new EnchantmentName(Enchantment.DIG_SPEED, langConfig.getString("enchantment.digging", "Efficiency"))); enchantmentNames.add(new EnchantmentName(Enchantment.DURABILITY, langConfig.getString("enchantment.durability", "Unbreaking"))); enchantmentNames.add(new EnchantmentName(Enchantment.FIRE_ASPECT, langConfig.getString("enchantment.fire", "Fire Aspect"))); @@ -670,7 +670,7 @@ public class LanguageUtils { entityNames.add(new EntityName(EntityType.SQUID, langConfig.getString("entity.Squid.name", "Squid"))); entityNames.add(new EntityName(EntityType.WOLF, langConfig.getString("entity.Wolf.name", "Wolf"))); entityNames.add(new EntityName(EntityType.MUSHROOM_COW, langConfig.getString("entity.MushroomCow.name", "Mooshroom"))); - entityNames.add(new EntityName(EntityType.OCELOT, langConfig.getString("entity.Ocelot.name", "Bat"))); + entityNames.add(new EntityName(EntityType.OCELOT, langConfig.getString("entity.Ozelot.name", "Ocelot"))); entityNames.add(new EntityName(EntityType.HORSE, langConfig.getString("entity.EntityHorse.name", "Horse"))); entityNames.add(new EntityName(EntityType.RABBIT, langConfig.getString("entity.Rabbit.name", "Rabbit"))); entityNames.add(new EntityName(EntityType.VILLAGER, langConfig.getString("entity.Villager.name", "Villager"))); @@ -827,7 +827,7 @@ public class LanguageUtils { messages.add(new LocalizedMessage(LocalizedMessage.Message.SHOP_INFO_ADMIN, langConfig.getString("message.shopInfo.is-admin", "&6Type: &eAdmin"))); messages.add(new LocalizedMessage(LocalizedMessage.Message.BUY_SELL_DISABLED, langConfig.getString("message.buy-and-sell-disabled", "&cYou can't create a shop with buying and selling disabled."))); messages.add(new LocalizedMessage(LocalizedMessage.Message.BUY_SUCCESS, langConfig.getString("message.buy-success", "&aYou bought &6%AMOUNT% x %ITEMNAME%&a for &6%BUY-PRICE%&a from &6%VENDOR%&a."), Regex.AMOUNT, Regex.ITEM_NAME, Regex.BUY_PRICE, Regex.VENDOR)); - messages.add(new LocalizedMessage(LocalizedMessage.Message.BUY_SUCESS_ADMIN, langConfig.getString("message.buy-sucess-admin", "&aYou bought &6%AMOUNT% x %ITEMNAME%&a for &6%BUY-PRICE%&a."), Regex.AMOUNT, Regex.ITEM_NAME, Regex.BUY_PRICE)); + messages.add(new LocalizedMessage(LocalizedMessage.Message.BUY_SUCESS_ADMIN, langConfig.getString("message.buy-success-admin", "&aYou bought &6%AMOUNT% x %ITEMNAME%&a for &6%BUY-PRICE%&a."), Regex.AMOUNT, Regex.ITEM_NAME, Regex.BUY_PRICE)); messages.add(new LocalizedMessage(LocalizedMessage.Message.SELL_SUCESS, langConfig.getString("message.sell-success", "&aYou sold &6%AMOUNT% x %ITEMNAME%&a for &6%SELL-PRICE%&a to &6%VENDOR%&a."), Regex.AMOUNT, Regex.ITEM_NAME, Regex.SELL_PRICE, Regex.VENDOR)); messages.add(new LocalizedMessage(LocalizedMessage.Message.SELL_SUCESS_ADMIN, langConfig.getString("message.sell-success-admin", "&aYou sold &6%AMOUNT% x %ITEMNAME%&a for &6%SELL-PRICE%&a."), Regex.AMOUNT, Regex.ITEM_NAME, Regex.SELL_PRICE)); messages.add(new LocalizedMessage(LocalizedMessage.Message.SOMEONE_BOUGHT, langConfig.getString("message.someone-bought", "&6%PLAYER% &abought &6%AMOUNT% x %ITEMNAME%&a for &6%BUY-PRICE%&a from your shop."), Regex.PLAYER, Regex.AMOUNT, Regex.ITEM_NAME, Regex.BUY_PRICE));