Fixed some localization errors

This commit is contained in:
Eric Biedert 2016-06-24 19:23:56 +02:00
parent 67016787df
commit 82cffd8c31
5 changed files with 23 additions and 10 deletions

View File

@ -1,4 +1,4 @@
message.shop-created=&6Shop erstellt. message.shop-created=&6Shop erstellt.
message.chest-already-shop=&cTruhe ist bereits ein Shop. message.chest-already-shop=&cTruhe ist bereits ein Shop.
message.shop-removed=&6Shop entfernt. message.shop-removed=&6Shop entfernt.
message.chest-no-shop=&cTruhe ist kein Shop. message.chest-no-shop=&cTruhe ist kein Shop.
@ -1113,6 +1113,7 @@ tile.blockGold.name=Goldblock
tile.blockIron.name=Eisenblock tile.blockIron.name=Eisenblock
tile.blockLapis.name=Lapislazuliblock tile.blockLapis.name=Lapislazuliblock
tile.blockRedstone.name=Redstone-Block tile.blockRedstone.name=Redstone-Block
tile.boneBlock.name=Knochenblock
tile.bookshelf.name=Bücherregal tile.bookshelf.name=Bücherregal
tile.brick.name=Ziegelsteine tile.brick.name=Ziegelsteine
tile.button.name=Knopf tile.button.name=Knopf
@ -1246,6 +1247,7 @@ tile.log.jungle.name=Tropenholz
tile.log.name=Holz tile.log.name=Holz
tile.log.oak.name=Eichenholz tile.log.oak.name=Eichenholz
tile.log.spruce.name=Fichtenholz tile.log.spruce.name=Fichtenholz
tile.magma.name=Magmablock
tile.melon.name=Melone tile.melon.name=Melone
tile.mobSpawner.name=Monsterspawner tile.mobSpawner.name=Monsterspawner
tile.monsterStoneEgg.brick.name=Steinziegel (Silberfischchen) tile.monsterStoneEgg.brick.name=Steinziegel (Silberfischchen)
@ -1262,6 +1264,7 @@ tile.netherBrick.name=Netherziegel
tile.netherFence.name=Netherziegelzaun tile.netherFence.name=Netherziegelzaun
tile.netherStalk.name=Netherwarze tile.netherStalk.name=Netherwarze
tile.netherquartz.name=Netherquarzerz tile.netherquartz.name=Netherquarzerz
tile.netherWartBlock.name=Netherwarzenblock
tile.notGate.name=Redstone-Fackel tile.notGate.name=Redstone-Fackel
tile.obsidian.name=Obsidian tile.obsidian.name=Obsidian
tile.oreCoal.name=Steinkohle tile.oreCoal.name=Steinkohle
@ -1291,6 +1294,7 @@ tile.quartzBlock.default.name=Quarzblock
tile.quartzBlock.lines.name=Quarzsäule tile.quartzBlock.lines.name=Quarzsäule
tile.quartzBlock.name=Quarzblock tile.quartzBlock.name=Quarzblock
tile.rail.name=Schiene tile.rail.name=Schiene
tile.redNetherBrick.name=Rote Netherziegel
tile.redSandStone.chiseled.name=Gemeißelter roter Sandstein tile.redSandStone.chiseled.name=Gemeißelter roter Sandstein
tile.redSandStone.default.name=Roter Sandstein tile.redSandStone.default.name=Roter Sandstein
tile.redSandStone.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.mossy.name=Bemooste Steinziegel
tile.stonebricksmooth.name=Steinziegel tile.stonebricksmooth.name=Steinziegel
tile.structureBlock.name=Konstruktionsblock tile.structureBlock.name=Konstruktionsblock
tile.structureVoid.name=Konstruktionsleere
tile.tallgrass.fern.name=Farn tile.tallgrass.fern.name=Farn
tile.tallgrass.grass.name=Gras tile.tallgrass.grass.name=Gras
tile.tallgrass.name=Gras tile.tallgrass.name=Gras

View File

@ -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'. # Set the vendor message the player gets after entering '/shop info'.
# Usable regex: %VENDOR% # 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'. # Set the product message the player gets after entering '/shop info'.
# Usable regex: %AMOUNT%, %ITEMNAME% # Usable regex: %AMOUNT%, %ITEMNAME%

View File

@ -68,7 +68,7 @@ public class ShopChest extends JavaPlugin {
} }
private void initLanguageConfig() { private void initLanguageConfig() {
langConfig = new LanguageConfiguration(); langConfig = new LanguageConfiguration(this);
File langFolder = new File(getDataFolder(), "lang"); File langFolder = new File(getDataFolder(), "lang");
if (!(new File(langFolder, "en_US.lang")).exists()) if (!(new File(langFolder, "en_US.lang")).exists())

View File

@ -1,5 +1,6 @@
package de.epiceric.shopchest.config; package de.epiceric.shopchest.config;
import de.epiceric.shopchest.ShopChest;
import org.bukkit.configuration.InvalidConfigurationException; import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.configuration.file.FileConfiguration; import org.bukkit.configuration.file.FileConfiguration;
@ -13,6 +14,12 @@ public class LanguageConfiguration extends FileConfiguration {
private ArrayList<String> lines = new ArrayList<>(); private ArrayList<String> lines = new ArrayList<>();
private HashMap<String, String> values = new HashMap<>(); private HashMap<String, String> values = new HashMap<>();
private ShopChest plugin;
public LanguageConfiguration(ShopChest plugin) {
this.plugin = plugin;
}
@Override @Override
public String saveToString() { public String saveToString() {
StringBuilder sb = new StringBuilder(""); StringBuilder sb = new StringBuilder("");
@ -33,6 +40,7 @@ public class LanguageConfiguration extends FileConfiguration {
} }
} }
plugin.getLogger().warning("Using default value for: " + path + " (" + def + ")");
return def; return def;
} }
@ -67,7 +75,7 @@ public class LanguageConfiguration extends FileConfiguration {
if (!line.startsWith("#")) { if (!line.startsWith("#")) {
if (line.contains("=")) { if (line.contains("=")) {
if (line.split("=").length == 2) { if (line.split("=").length >= 2) {
String key = line.split("=")[0]; String key = line.split("=")[0];
StringBuilder sbValue = new StringBuilder(); StringBuilder sbValue = new StringBuilder();

View File

@ -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_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.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.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, 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, 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, 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.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.BED, langConfig.getString("tile.bed.name", "Bed")));
itemNames.add(new ItemName(Material.POWERED_RAIL, langConfig.getString("tile.goldenRail.name", "Powered Rail"))); 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.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_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_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.DIG_SPEED, langConfig.getString("enchantment.digging", "Efficiency")));
enchantmentNames.add(new EnchantmentName(Enchantment.DURABILITY, langConfig.getString("enchantment.durability", "Unbreaking"))); enchantmentNames.add(new EnchantmentName(Enchantment.DURABILITY, langConfig.getString("enchantment.durability", "Unbreaking")));
enchantmentNames.add(new EnchantmentName(Enchantment.FIRE_ASPECT, langConfig.getString("enchantment.fire", "Fire Aspect"))); 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.SQUID, langConfig.getString("entity.Squid.name", "Squid")));
entityNames.add(new EntityName(EntityType.WOLF, langConfig.getString("entity.Wolf.name", "Wolf"))); 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.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.HORSE, langConfig.getString("entity.EntityHorse.name", "Horse")));
entityNames.add(new EntityName(EntityType.RABBIT, langConfig.getString("entity.Rabbit.name", "Rabbit"))); entityNames.add(new EntityName(EntityType.RABBIT, langConfig.getString("entity.Rabbit.name", "Rabbit")));
entityNames.add(new EntityName(EntityType.VILLAGER, langConfig.getString("entity.Villager.name", "Villager"))); 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.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_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_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, 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.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)); 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));