diff options
author | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-09 21:07:00 +0000 |
---|---|---|
committer | snowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-05-09 21:07:00 +0000 |
commit | 1427599007d63ccaa6829608e5f3e7c012de7b9f (patch) | |
tree | dabb49de4ccd294a069d0bc565768523041b4773 | |
parent | bb7ddea328780d4e5f243191a94bcc84c22d74f0 (diff) | |
download | Essentials-1427599007d63ccaa6829608e5f3e7c012de7b9f.tar Essentials-1427599007d63ccaa6829608e5f3e7c012de7b9f.tar.gz Essentials-1427599007d63ccaa6829608e5f3e7c012de7b9f.tar.lz Essentials-1427599007d63ccaa6829608e5f3e7c012de7b9f.tar.xz Essentials-1427599007d63ccaa6829608e5f3e7c012de7b9f.zip |
More translation stuff
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1397 e251c2fe-e539-e718-e476-b85c1f46cddb
3 files changed, 21 insertions, 13 deletions
diff --git a/Essentials/src/com/earth2me/essentials/EssentialsConf.java b/Essentials/src/com/earth2me/essentials/EssentialsConf.java index 097d02ce8..7520194a0 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsConf.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsConf.java @@ -46,19 +46,19 @@ public class EssentialsConf extends Configuration { if (templateName != null) { - logger.log(Level.INFO, "Creating config from template: " + configFile.toString()); + logger.log(Level.INFO, Util.format("creatingConfigFromTemplate ", configFile.toString())); createFromTemplate(); } else { try { - logger.log(Level.INFO, "Creating empty config: " + configFile.toString()); + logger.log(Level.INFO, Util.format("creatingEmptyConfig", configFile.toString())); configFile.createNewFile(); } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to create config " + configFile.toString(), ex); + logger.log(Level.SEVERE, Util.format("failedToCreateConfig", configFile.toString()), ex); } } } @@ -77,7 +77,7 @@ public class EssentialsConf extends Configuration InputStream istr = resourceClass.getResourceAsStream(templateName); if (istr == null) { - logger.log(Level.SEVERE, "Could not find template " + templateName); + logger.log(Level.SEVERE, Util.format("couldNotFindTemplate", templateName)); return; } ostr = new FileOutputStream(configFile); @@ -93,7 +93,7 @@ public class EssentialsConf extends Configuration } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to write config " + configFile.toString(), ex); + logger.log(Level.SEVERE, Util.format("failedToWriteConfig", configFile.toString()), ex); return; } finally @@ -107,7 +107,7 @@ public class EssentialsConf extends Configuration } catch (IOException ex) { - logger.log(Level.SEVERE, "Failed to close config " + configFile.toString(), ex); + logger.log(Level.SEVERE, Util.format("failedToCloseConfig", configFile.toString()), ex); return; } } diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java index ffe2037f2..fa39eb79e 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEcoBlockListener.java @@ -59,7 +59,7 @@ public class EssentialsEcoBlockListener extends BlockListener double r2 = Double.parseDouble(l2[m2 ? 1 : 2]); if ((!m1 & q1 < 1) || (!m2 & q2 < 1)) { - throw new Exception("Quantities must be greater than 0."); + throw new Exception(Util.i18n("moreThanZero")); } ItemStack i1 = m1 || r1 <= 0 ? null : ItemDb.get(l1[1], (int)r1); @@ -87,7 +87,7 @@ public class EssentialsEcoBlockListener extends BlockListener } catch (Throwable ex) { - user.sendMessage("§cError: " + ex.getMessage()); + user.sendMessage(Util.format("errorWithMessage", ex.getMessage())); } return; } @@ -167,7 +167,7 @@ public class EssentialsEcoBlockListener extends BlockListener r2 = m2 ? r2 : r2 - r2 % q2; if ((!m1 & q1 < 1) || (!m2 &q2 < 1) || r2 < 1) { - throw new Exception("Quantities must be greater than 0."); + throw new Exception(Util.i18n("moreThanZero")); } if (!m1) { @@ -178,17 +178,17 @@ public class EssentialsEcoBlockListener extends BlockListener { if (user.getMoney() < r2) { - throw new Exception("You do not have sufficient funds."); + throw new Exception(Util.i18n("notEnoughMoney")); } user.takeMoney(r2); - user.sendMessage("r2: " + r2 + " q2: " + q2); + //user.sendMessage("r2: " + r2 + " q2: " + q2); } else { ItemStack i2 = ItemDb.get(l2[1], (int)r2); if (!InventoryWorkaround.containsItem(user.getInventory(), true, i2)) { - throw new Exception("You do not have " + r2 + "x " + l2[1] + "."); + throw new Exception(Util.format("missingItems", r2, l2[1])); } InventoryWorkaround.removeItem(user.getInventory(), true, i2); user.updateInventory(); diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index db04cd8b2..11e89f020 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -26,4 +26,12 @@ bannedIpsFileNotFound = banned-ips.txt not found bannedIpsFileError = Error reading banned-ips.txt noDestroyPermission = \u00a7cYou do not have permission to destroy that {0}. moreThanZero = Quantities must be greater than 0. -errorWithMessage = \u00a7cError: {0}
\ No newline at end of file +errorWithMessage = \u00a7cError: {0} +creatingConfigFromTemplate = Creating config from template: {0} +creatingEmptyConfig = Creating empty config: {0} +failedToCreateConfig = Failed to create config {0} +couldNotFindTemplate = Could not find template {0} +failedToWriteConfig = Failed to write config {0} +failedToCloseConfig = Failed to close config {0} +notEnoughMoney = You do not have sufficient funds. +missingItems = You do not have {0}x {1}.
\ No newline at end of file |