From 077074c85503b25ebe923a71add3e010c96a4243 Mon Sep 17 00:00:00 2001 From: "Luke Anderson (stuntguy3000)" Date: Sat, 8 Mar 2014 16:51:50 +1030 Subject: Add missing language pointers --- .../src/com/earth2me/essentials/commands/Commandgamemode.java | 3 +-- .../src/com/earth2me/essentials/commands/Commandmail.java | 10 ++++++---- Essentials/src/com/earth2me/essentials/commands/Commandtp.java | 4 ++-- .../src/com/earth2me/essentials/commands/Commandtppos.java | 4 ++-- .../src/com/earth2me/essentials/commands/Commandweather.java | 3 +-- Essentials/src/messages.properties | 7 ++++++- 6 files changed, 18 insertions(+), 13 deletions(-) diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java index c24a08a9c..8c5c36aac 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandgamemode.java @@ -79,10 +79,9 @@ public class Commandgamemode extends EssentialsCommand private void gamemodeOtherPlayers(final Server server, final CommandSource sender, final GameMode gameMode, final String name) throws NotEnoughArgumentsException, PlayerNotFoundException { - //TODO: TL this if (name.trim().length() < 2 || gameMode == null) { - throw new NotEnoughArgumentsException("You need to specify a valid player/mode."); + throw new NotEnoughArgumentsException(_("gameModeInvalid")); } boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.vanish.interact"); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java index cb7ba174f..b9f9a7b69 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandmail.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandmail.java @@ -1,13 +1,15 @@ package com.earth2me.essentials.commands; import com.earth2me.essentials.CommandSource; -import static com.earth2me.essentials.I18n._; import com.earth2me.essentials.User; import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.StringUtil; -import java.util.List; import org.bukkit.Server; +import java.util.List; + +import static com.earth2me.essentials.I18n._; + public class Commandmail extends EssentialsCommand { @@ -60,7 +62,7 @@ public class Commandmail extends EssentialsCommand final String mail = user.getName() + ": " + StringUtil.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2))); if (mail.length() > 1000) { - throw new Exception("Mail message too long. Try to keep it below 1000"); + throw new Exception(_("mailTooLong")); } if (Math.abs(System.currentTimeMillis() - timestamp) > 60000) { @@ -70,7 +72,7 @@ public class Commandmail extends EssentialsCommand mailsPerMinute++; if (mailsPerMinute > ess.getSettings().getMailsPerMinute()) { - throw new Exception("Too many mails have been send within the last minute. Maximum: " + ess.getSettings().getMailsPerMinute()); + throw new Exception(_("mailDelay", ess.getSettings().getMailsPerMinute())); } u.addMail(mail); } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java index 28ae06f39..99fc3da8a 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtp.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtp.java @@ -51,7 +51,7 @@ public class Commandtp extends EssentialsCommand final double z = args[3].startsWith("~") ? target2.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]); if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n + throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); } final Location loc = new Location(target2.getWorld(), x, y, z, target2.getLocation().getYaw(), target2.getLocation().getPitch()); if (!target2.isTeleportEnabled()) @@ -111,7 +111,7 @@ public class Commandtp extends EssentialsCommand final double z = args[3].startsWith("~") ? target.getLocation().getZ() + Integer.parseInt(args[3].substring(1)) : Integer.parseInt(args[3]); if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n + throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); } final Location loc = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch()); target.getTeleport().now(loc, false, TeleportCause.COMMAND); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java index a3b703510..a33352333 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandtppos.java @@ -38,7 +38,7 @@ public class Commandtppos extends EssentialsCommand } if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n + throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); } final Trade charge = new Trade(this.getName(), ess); charge.isAffordableFor(user); @@ -70,7 +70,7 @@ public class Commandtppos extends EssentialsCommand } if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) { - throw new NotEnoughArgumentsException("Value of coordinates cannot be over 30000000"); //TODO: I18n + throw new NotEnoughArgumentsException(_("teleportInvalidLocation")); } sender.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java index c59c88930..287efe359 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandweather.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandweather.java @@ -58,7 +58,6 @@ public class Commandweather extends EssentialsCommand } } - //TODO: Translate these @Override protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception { @@ -71,7 +70,7 @@ public class Commandweather extends EssentialsCommand final World world = server.getWorld(args[0]); if (world == null) { - throw new Exception("World named " + args[0] + " not found!"); + throw new Exception(_("weatherInvalidWorldWorld", args[0])); } if (args.length > 2) { diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties index 9a7fb76d5..e0e1273de 100644 --- a/Essentials/src/messages.properties +++ b/Essentials/src/messages.properties @@ -539,4 +539,9 @@ skullChanged=\u00a76Skull changed to \u00a7c{0}.\u00a76. alphaNames=\u00a74Player names can only contain letters, numbers and underscores. givenSkull=\u00a76You have been given the Skull of \u00a7c{0}\u00a76. noPermissionSkull=\u00a74You do not have permission to modify that Skull. -invalidSkull=\u00a74Please hold a player Skull. \ No newline at end of file +teleportInvalidLocation=Value of coordinates cannot be over 30000000 +invalidSkull=\u00a74Please hold a player Skull. +weatherInvalidWorld=World named {0} not found! +gameModeInvalid=\u00a74You need to specify a valid player/mode. +mailTooLong=\u00a74Mail message too long. Try to keep it below 1000 +mailDelay=Too many mails have been sent within the last minute. Maximum\: {0} \ No newline at end of file -- cgit v1.2.3