summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-15 01:30:54 +0000
committersnowleo <snowleo@e251c2fe-e539-e718-e476-b85c1f46cddb>2011-05-15 01:30:54 +0000
commit5eeb020f01e77eaaa364b93c21133886e0b97ed5 (patch)
tree3712fb70add28e87af35c49d0438386b844c848f
parentc107f7ed66f30755a9b0104f6a0c913612121070 (diff)
downloadEssentials-5eeb020f01e77eaaa364b93c21133886e0b97ed5.tar
Essentials-5eeb020f01e77eaaa364b93c21133886e0b97ed5.tar.gz
Essentials-5eeb020f01e77eaaa364b93c21133886e0b97ed5.tar.lz
Essentials-5eeb020f01e77eaaa364b93c21133886e0b97ed5.tar.xz
Essentials-5eeb020f01e77eaaa364b93c21133886e0b97ed5.zip
Finally all commands translated.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1471 e251c2fe-e539-e718-e476-b85c1f46cddb
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java13
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpall.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java18
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtphere.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpo.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtppos.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java5
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandtree.java4
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunban.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java3
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java16
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwarp.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandweather.java9
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandwhois.java19
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworld.java7
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/Commandworth.java22
-rw-r--r--Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java9
-rw-r--r--Essentials/src/messages.properties37
-rw-r--r--Essentials/src/messages_de.properties37
21 files changed, 166 insertions, 75 deletions
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
index bd59bd23c..752ac7ac2 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpaccept.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtpaccept extends EssentialsCommand
@@ -18,21 +19,19 @@ public class Commandtpaccept extends EssentialsCommand
User p = user.getTeleportRequest();
if (p == null)
{
- throw new Exception("You do not have a pending request.");
+ throw new Exception(Util.i18n("noPendingRequest"));
}
+ user.canAfford(this);
+ user.sendMessage(Util.i18n("requestAccepted"));
+ p.sendMessage(Util.i18n("requestAccepted"));
+
if (user.isTeleportRequestHere())
{
- user.canAfford(this);
- user.sendMessage("§7Teleport request accepted.");
- p.sendMessage("§7Teleport request accepted.");
user.getTeleport().teleport(p, this.getName());
}
else
{
- user.canAfford(this);
- user.sendMessage("§7Teleport request accepted.");
- p.sendMessage("§7Teleport request accepted.");
p.getTeleport().teleport(user, this.getName());
}
user.requestTeleport(null, false);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
index 27e586fb5..414a5b28f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpahere.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtpahere extends EssentialsCommand
@@ -22,12 +23,12 @@ public class Commandtpahere extends EssentialsCommand
User p = getPlayer(server, args, 0);
if (!p.isTeleportEnabled())
{
- throw new Exception(p.getDisplayName() + " has teleportation disabled.");
+ throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
}
user.charge(this);
p.requestTeleport(user, true);
- p.sendMessage("§c" + user.getDisplayName() + "§c has requested that you teleport to him/her.");
- p.sendMessage("§7To teleport, type §c/tpaccept§7.");
- user.sendMessage("§7Request sent to " + p.getDisplayName() + "§c.");
+ p.sendMessage(Util.format("teleportHereRequest", user.getDisplayName()));
+ p.sendMessage(Util.i18n("typeTpaccept"));
+ user.sendMessage(Util.format("requestSent", p.getDisplayName()));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
index a2b671054..6cc0c55ca 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpall.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
@@ -34,7 +35,7 @@ public class Commandtpall extends EssentialsCommand
private void teleportAllPlayers(Server server, CommandSender sender, User p)
{
- sender.sendMessage("§7Teleporting all players...");
+ sender.sendMessage(Util.i18n("teleportAll"));
for (Player player : server.getOnlinePlayers())
{
User u = ess.getUser(player);
@@ -48,7 +49,7 @@ public class Commandtpall extends EssentialsCommand
}
catch (Exception ex)
{
- sender.sendMessage("Error: "+ex.getMessage());
+ sender.sendMessage(Util.format("errorWithMessage", ex.getMessage()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
index eb266fad5..f5b7f5801 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpdeny.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtpdeny extends EssentialsCommand
@@ -17,21 +18,12 @@ public class Commandtpdeny extends EssentialsCommand
User p = user.getTeleportRequest();
if (p == null)
{
- throw new Exception("You do not have a pending request.");
+ throw new Exception(Util.i18n("noPendingRequest"));
}
- if (user.isTeleportRequestHere())
- {
- user.charge(this);
- user.sendMessage("§7Teleport request denied.");
- p.sendMessage("§7Teleport request denied.");
- }
- else
- {
- user.charge(this);
- user.sendMessage("§7Teleport request denied.");
- p.sendMessage("§7Teleport request denied.");
- }
+ user.charge(this);
+ user.sendMessage(Util.i18n("requestDenied"));
+ p.sendMessage(Util.i18n("requestDenied"));
user.requestTeleport(null, false);
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
index 59c097591..f0c206ff3 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtphere.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtphere extends EssentialsCommand
@@ -17,10 +18,10 @@ public class Commandtphere extends EssentialsCommand
User p = getPlayer(server, args, 0);
if (!p.isTeleportEnabled())
{
- throw new Exception(p.getDisplayName() + " has teleportation disabled.");
+ throw new Exception(Util.format("teleportDisabled", p.getDisplayName()));
}
p.getTeleport().teleport(user, commandLabel);
- user.sendMessage("§7Teleporting...");
- p.sendMessage("§7Teleporting...");
+ user.sendMessage(Util.i18n("teleporting"));
+ p.sendMessage(Util.i18n("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
index b9db3a0d3..6b74f5062 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpo.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtpo extends EssentialsCommand
@@ -23,6 +24,6 @@ public class Commandtpo extends EssentialsCommand
User p = getPlayer(server, args, 0);
charge(user);
user.getTeleport().now(p);
- user.sendMessage("§7Teleporting...");
+ user.sendMessage(Util.i18n("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
index cd787cec9..5dc7a4478 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtpohere.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtpohere extends EssentialsCommand
@@ -23,6 +24,6 @@ public class Commandtpohere extends EssentialsCommand
User p = getPlayer(server, args, 0);
charge(user);
p.getTeleport().now(user);
- user.sendMessage("§7Teleporting...");
+ user.sendMessage(Util.i18n("teleporting"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
index 2814f2f11..2f32237a1 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtppos extends EssentialsCommand
@@ -25,7 +26,7 @@ public class Commandtppos extends EssentialsCommand
int z = Integer.parseInt(args[2]);
Location l = new Location(user.getWorld(), x, y, z);
user.canAfford(this);
- user.sendMessage("§7Teleporting...");
+ user.sendMessage(Util.i18n("teleporting"));
user.getTeleport().teleport(l, this.getName());
}
} \ No newline at end of file
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
index 01c88b090..38236d475 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtptoggle.java
@@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandtptoggle extends EssentialsCommand
@@ -15,6 +16,8 @@ public class Commandtptoggle extends EssentialsCommand
public void run(Server server, User user, String commandLabel, String[] args) throws Exception
{
charge(user);
- user.sendMessage("§7Teleportation " + (user.toggleTeleportEnabled() ? "enabled." : "disabled."));
+ user.sendMessage(user.toggleTeleportEnabled()
+ ? Util.i18n("teleportationEnabled")
+ : Util.i18n("teleportationDisabled"));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
index 2bbf0f769..6c90a8b7f 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandtree.java
@@ -67,11 +67,11 @@ public class Commandtree extends EssentialsCommand
if (success)
{
user.charge(this);
- user.sendMessage("§7Tree spawned.");
+ user.sendMessage(Util.i18n("treeSpawned"));
}
else
{
- user.sendMessage("§cTree generation failure. Try again on grass or dirt.");
+ user.sendMessage(Util.i18n("treeFailure"));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
index 3b825ce86..dbad49f40 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunban.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.CraftServer;
@@ -21,7 +22,7 @@ public class Commandunban extends EssentialsCommand
}
((CraftServer)server).getHandle().b(args[0]);
- sender.sendMessage("Unbanned player.");
+ sender.sendMessage(Util.i18n("unbannedPlayer"));
ess.loadBanList();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
index 48194dd03..c7ec57985 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunbanip.java
@@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
+import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.craftbukkit.CraftServer;
@@ -21,7 +22,7 @@ public class Commandunbanip extends EssentialsCommand
}
((CraftServer)server).getHandle().d(args[0]);
- sender.sendMessage("Unbanned IP address.");
+ sender.sendMessage(Util.i18n("unbannedIP"));
ess.loadBanList();
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
index a5df6bee6..b6941d5e6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandunlimited.java
@@ -3,8 +3,8 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.InventoryWorkaround;
import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.List;
-import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@@ -35,12 +35,12 @@ public class Commandunlimited extends EssentialsCommand
if (args[0].equalsIgnoreCase("list"))
{
StringBuilder sb = new StringBuilder();
- sb.append("Unlimited items: ");
+ sb.append(Util.i18n("unlimitedItems")).append(" ");
boolean first = true;
List<Integer> items = target.getUnlimited();
if (items.isEmpty())
{
- sb.append("none");
+ sb.append(Util.i18n("none"));
}
for (Integer integer : items)
{
@@ -65,7 +65,7 @@ public class Commandunlimited extends EssentialsCommand
&& !((stack.getType() == Material.WATER_BUCKET || stack.getType() == Material.LAVA_BUCKET)
&& user.isAuthorized("essentials.unlimited.item-bucket")))
{
- user.sendMessage(ChatColor.RED + "No permission for unlimited item " + itemname + ".");
+ user.sendMessage(Util.format("unlimitedItemPermission", itemname));
return;
}
@@ -74,18 +74,18 @@ public class Commandunlimited extends EssentialsCommand
{
if (user != target)
{
- user.sendMessage("§7Disable unlimited placing of " + itemname + " for " + target.getDisplayName() + ".");
+ user.sendMessage(Util.format("disableUnlimited", itemname, target.getDisplayName()));
}
- target.sendMessage("§7Disable unlimited placing of " + itemname + " for " + target.getDisplayName() + ".");
+ target.sendMessage(Util.format("disableUnlimited", itemname, target.getDisplayName()));
target.setUnlimited(stack, false);
return;
}
charge(user);
if (user != target)
{
- user.sendMessage("§7Giving unlimited amount of " + itemname + " to " + target.getDisplayName() + ".");
+ user.sendMessage(Util.format("enableUnlimited", itemname, target.getDisplayName()));
}
- target.sendMessage("§7Giving unlimited amount of " + itemname + " to " + target.getDisplayName() + ".");
+ target.sendMessage(Util.format("enableUnlimited", itemname, target.getDisplayName()));
if (!InventoryWorkaround.containsItem(target.getInventory(), true, stack))
{
target.getInventory().addItem(stack);
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
index ba9cc8c4a..6429892ff 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwarp.java
@@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import com.earth2me.essentials.Warps;
import org.bukkit.command.CommandSender;
@@ -22,14 +23,14 @@ public class Commandwarp extends EssentialsCommand
{
if (!user.isAuthorized("essentials.warp.list"))
{
- user.sendMessage("§cYou do not have Permission to list that warps.");
+ user.sendMessage(Util.i18n("warpListPermission"));
return;
}
Warps warps = Essentials.getWarps();
if (warps.isEmpty())
{
- throw new Exception("No warps defined");
+ throw new Exception(Util.i18n("noWarpsDefined"));
}
StringBuilder sb = new StringBuilder();
int i = 0;
@@ -61,7 +62,7 @@ public class Commandwarp extends EssentialsCommand
otherUser = ess.getUser(server.getPlayer(args[1]));
if(otherUser == null)
{
- user.sendMessage("§cPlayer not found");
+ user.sendMessage(Util.i18n("playerNotFound"));
return;
}
warpUser(otherUser, args[0]);
@@ -80,7 +81,7 @@ public class Commandwarp extends EssentialsCommand
user.getTeleport().warp(name, this.getName());
return;
}
- user.sendMessage("§cYou do not have Permission to use that warp.");
+ user.sendMessage(Util.i18n("warpUsePermission"));
return;
}
user.getTeleport().warp(name, this.getName());
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
index 07ea07699..6e846dab9 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java
@@ -1,6 +1,7 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.World;
@@ -28,13 +29,17 @@ public class Commandweather extends EssentialsCommand
world.setStorm(isStorm ? true : false);
world.setWeatherDuration(Integer.parseInt(args[1]) * 20);
- user.sendMessage("§7You set the weather to " + (isStorm ? "storm" : "sun") + " in your world for " + args[1] + " seconds");
+ user.sendMessage(isStorm
+ ? Util.format("weatherStormFor", args[1])
+ : Util.format("weatherSunFor", args[1]));
return;
}
else
{
world.setStorm(isStorm ? true : false);
- user.sendMessage("§7You set the weather to " + (isStorm ? "storm" : "sun") + " in your world");
+ user.sendMessage(isStorm
+ ? Util.i18n("weatherStorm")
+ : Util.i18n("weatherSun"));
return;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
index 5a1b64575..b9d99a682 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandwhois.java
@@ -20,8 +20,7 @@ public class Commandwhois extends EssentialsCommand
{
if (args.length < 1)
{
- sender.sendMessage("§cUsage: /whois [nickname]");
- return;
+ throw new NotEnoughArgumentsException();
}
String whois = args[0].toLowerCase();
charge(sender);
@@ -37,20 +36,22 @@ public class Commandwhois extends EssentialsCommand
continue;
}
sender.sendMessage("");
- sender.sendMessage(u.getDisplayName() + " is " + u.getName());
- sender.sendMessage(ChatColor.BLUE + " - Health: " + u.getHealth() + "/20");
- sender.sendMessage(ChatColor.BLUE + " - Location: (" + u.getLocation().getWorld().getName() + ", " + u.getLocation().getBlockX() + ", " + u.getLocation().getBlockY() + ", " + u.getLocation().getBlockZ() + ")");
+ sender.sendMessage(Util.format("whoisIs", u.getDisplayName(), u.getName()));
+ sender.sendMessage(Util.format("whoisHealth", u.getHealth()));
+ sender.sendMessage(Util.format("whoisLocation", u.getLocation().getWorld().getName(), u.getLocation().getBlockX(), u.getLocation().getBlockY(), u.getLocation().getBlockZ()));
if (!ess.getConfiguration().getBoolean("disable-eco", false))
{
- sender.sendMessage(ChatColor.BLUE + " - Money: " + Util.formatCurrency(u.getMoney()));
+ sender.sendMessage(Util.format("whoisMoney", Util.formatCurrency(u.getMoney())));
}
- sender.sendMessage(ChatColor.BLUE + " - Status: " + (u.isAfk() ? "§cAway§f" : "Available"));
- sender.sendMessage(ChatColor.BLUE + " - IP Address: " + u.getAddress().getAddress().toString());
+ sender.sendMessage(u.isAfk()
+ ? Util.i18n("whoisStatusAway")
+ : Util.i18n("whoisStatusAvailable"));
+ sender.sendMessage(Util.format("whoisIPAddress", u.getAddress().getAddress().toString()));
String location = u.getGeoLocation();
if (location != null
&& (sender instanceof Player ? ess.getUser(sender).isAuthorized("essentials.geoip.show") : true))
{
- sender.sendMessage(ChatColor.BLUE + " - Location: " + location.toString());
+ sender.sendMessage(Util.format("whoisGeoLocation", location.toString()));
}
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
index 044e0868e..a2f7d15d6 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworld.java
@@ -6,6 +6,7 @@ import org.bukkit.Server;
import org.bukkit.World;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
public class Commandworld extends EssentialsCommand
@@ -43,9 +44,9 @@ public class Commandworld extends EssentialsCommand
world = ess.getWorld(getFinalArg(args, 0));
if (world == null)
{
- user.sendMessage("§cInvalid world.");
- user.sendMessage("§7Possible worlds are the numbers 0 through " + (server.getWorlds().size() - 1) + ".");
- user.sendMessage("§7You can also type the name of a specific world.");
+ user.sendMessage(Util.i18n("invalidWorld"));
+ user.sendMessage(Util.format("possibleWorlds", server.getWorlds().size() - 1));
+ user.sendMessage(Util.i18n("typeWorldName"));
return;
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
index 069061c78..af86e5bec 100644
--- a/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
+++ b/Essentials/src/com/earth2me/essentials/commands/Commandworth.java
@@ -10,7 +10,6 @@ import org.bukkit.inventory.ItemStack;
public class Commandworth extends EssentialsCommand
{
-
public Commandworth()
{
super("worth");
@@ -43,14 +42,21 @@ public class Commandworth extends EssentialsCommand
double worth = Essentials.getWorth().getPrice(is);
if (Double.isNaN(worth))
{
- throw new Exception("That item cannot be sold to the server.");
+ throw new Exception(Util.i18n("itemCannotBeSold"));
}
- user.charge(this);
- user.sendMessage("§7Stack of "
- + is.getType().toString().toLowerCase().replace("_", "")
- + (is.getDurability() !=0 ? " with metadata of "+ String.valueOf(is.getDurability()) : "")
- + " worth §c" + Util.formatCurrency(worth*amount) + "§7 ("
- + amount + " item(s) at " + Util.formatCurrency(worth) + " each)");
+ user.charge(this);
+ user.sendMessage(is.getDurability() != 0
+ ? Util.format("worthMeta",
+ is.getType().toString().toLowerCase().replace("_", ""),
+ is.getDurability(),
+ Util.formatCurrency(worth * amount),
+ amount,
+ Util.formatCurrency(worth))
+ : Util.format("worth",
+ is.getType().toString().toLowerCase().replace("_", ""),
+ Util.formatCurrency(worth * amount),
+ amount,
+ Util.formatCurrency(worth)));
}
}
diff --git a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
index c7264c21d..ab2c3c2ed 100644
--- a/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
+++ b/Essentials/src/com/earth2me/essentials/commands/EssentialsCommand.java
@@ -7,6 +7,7 @@ import org.bukkit.command.CommandSender;
import com.earth2me.essentials.Essentials;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
+import com.earth2me.essentials.Util;
import java.util.logging.Logger;
@@ -27,11 +28,11 @@ public abstract class EssentialsCommand implements IEssentialsCommand
return name;
}
- protected User getPlayer(Server server, String[] args, int pos) throws IndexOutOfBoundsException, NoSuchFieldException
+ protected User getPlayer(Server server, String[] args, int pos) throws NoSuchFieldException, NotEnoughArgumentsException
{
- if (args.length <= pos) throw new IndexOutOfBoundsException("§cInvalid command syntax. Did you forget an argument?");
+ if (args.length <= pos) throw new NotEnoughArgumentsException();
List<Player> matches = server.matchPlayer(args[pos]);
- if (matches.size() < 1) throw new NoSuchFieldException("§cNo matching players could be found.");
+ if (matches.size() < 1) throw new NoSuchFieldException(Util.i18n("noPlayerFound"));
for (Player p : matches)
{
if (p.getDisplayName().startsWith(args[pos]))
@@ -61,7 +62,7 @@ public abstract class EssentialsCommand implements IEssentialsCommand
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
- throw new Exception("Only in-game players can use " + commandLabel + ".");
+ throw new Exception(Util.format("onlyPlayers", commandLabel));
}
public static String getFinalArg(String[] args, int start)
diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties
index 2df9f1745..559bb6740 100644
--- a/Essentials/src/messages.properties
+++ b/Essentials/src/messages.properties
@@ -263,3 +263,40 @@ teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
requestSent = \u00a77Request sent to {0}\u00a77.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportAll = \u00a77Teleporting all players...
+noPendingRequest = You do not have a pending request.
+requestDenied = \u00a77Teleport request denied.
+requestAccepted = \u00a77Teleport request accepted.
+teleportationEnabled = \u00a77Teleportation enabled.
+teleportationDisabled = \u00a77Teleportation disabled.
+treeSpawned = \u00a77Tree spawned.
+treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
+unbannedPlayer = Unbanned player.
+unbannedIP = Unbanned IP address.
+unlimitedItems = Unlimited items:
+none = none
+unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
+disableUnlimited = \u00a77Disable unlimited placing of {0} for {1}.
+enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+warpListPermission = \u00a7cYou do not have Permission to list that warps.
+noWarpsDefined = No warps defined
+warpUsePermission = \u00a7cYou do not have Permission to use that warp.
+weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
+weatherSun = \u00a77You set the weather to sun in your world
+weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+weatherStorm = \u00a77You set the weather to storm in your world
+whoisIs = {0} is {1}
+whoisHealth = \u00a79 - Health: {0}/20
+whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
+whoisMoney = \u00a79 - Money: {0}
+whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
+whoisStatusAvailable = \u00a79 - Status: Available
+whoisIPAddress = \u00a79 - IP Address: {0}
+whoisGeoLocation = \u00a79 - Location: {0}
+invalidWorld = \u00a7cInvalid world.
+possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
+typeWorldName = \u00a77You can also type the name of a specific world.
+worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
+worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
+onlyPlayers = Only in-game players can use {0}. \ No newline at end of file
diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties
index 1639baf2b..0166b21ac 100644
--- a/Essentials/src/messages_de.properties
+++ b/Essentials/src/messages_de.properties
@@ -263,3 +263,40 @@ teleportRequest = \u00a7c{0}\u00a7c has requested to teleport to you.
typeTpaccept = \u00a77To teleport, type \u00a7c/tpaccept\u00a77.
typeTpdeny = \u00a77To deny this request, type \u00a7c/tpdeny\u00a77.
requestSent = \u00a77Request sent to {0}\u00a77.
+teleportHereRequest = \u00a7c{0}\u00a7c has requested that you teleport to him/her.
+teleportAll = \u00a77Teleporting all players...
+noPendingRequest = You do not have a pending request.
+requestDenied = \u00a77Teleport request denied.
+requestAccepted = \u00a77Teleport request accepted.
+teleportationEnabled = \u00a77Teleportation enabled.
+teleportationDisabled = \u00a77Teleportation disabled.
+treeSpawned = \u00a77Tree spawned.
+treeFailure = \u00a7cTree generation failure. Try again on grass or dirt.
+unbannedPlayer = Unbanned player.
+unbannedIP = Unbanned IP address.
+unlimitedItems = Unlimited items:
+none = none
+unlimitedItemPermission = \u00a7cNo permission for unlimited item {0}.
+disableUnlimited = \u00a77Disable unlimited placing of {0} for {1}.
+enableUnlimited = \u00a77Giving unlimited amount of {0} to {1}.
+warpListPermission = \u00a7cYou do not have Permission to list that warps.
+noWarpsDefined = No warps defined
+warpUsePermission = \u00a7cYou do not have Permission to use that warp.
+weatherSunFor = \u00a77You set the weather to sun in your world for {0} seconds
+weatherSun = \u00a77You set the weather to sun in your world
+weatherStormFor = \u00a77You set the weather to storm in your world for {0} seconds
+weatherStorm = \u00a77You set the weather to storm in your world
+whoisIs = {0} is {1}
+whoisHealth = \u00a79 - Health: {0}/20
+whoisLocation = \u00a79 - Location: ({0}, {1}, {2}, {3})
+whoisMoney = \u00a79 - Money: {0}
+whoisStatusAway = \u00a79 - Status: \u00a7cAway\u00a7f
+whoisStatusAvailable = \u00a79 - Status: Available
+whoisIPAddress = \u00a79 - IP Address: {0}
+whoisGeoLocation = \u00a79 - Location: {0}
+invalidWorld = \u00a7cInvalid world.
+possibleWorlds = \u00a77Possible worlds are the numbers 0 through {0}.
+typeWorldName = \u00a77You can also type the name of a specific world.
+worth = \u00a77Stack of {0} worth \u00a7c{1}\u00a77 ({2} item(s) at {3} each)
+worthMeta = \u00a77Stack of {0} with metadata of {1} worth \u00a7c{2}\u00a77 ({3} item(s) at {4} each)
+onlyPlayers = Only in-game players can use {0}.