1
0
mirror of https://github.com/essentials/Essentials.git synced 2025-08-13 18:14:38 +02:00

Add missing language pointers

This commit is contained in:
Luke Anderson (stuntguy3000)
2014-03-08 16:51:50 +10:30
committed by KHobbits
parent c59a204827
commit 077074c855
6 changed files with 18 additions and 13 deletions

View File

@@ -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 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) 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"); boolean skipHidden = sender.isPlayer() && !ess.getUser(sender.getPlayer()).isAuthorized("essentials.vanish.interact");

View File

@@ -1,13 +1,15 @@
package com.earth2me.essentials.commands; package com.earth2me.essentials.commands;
import com.earth2me.essentials.CommandSource; import com.earth2me.essentials.CommandSource;
import static com.earth2me.essentials.I18n._;
import com.earth2me.essentials.User; import com.earth2me.essentials.User;
import com.earth2me.essentials.utils.FormatUtil; import com.earth2me.essentials.utils.FormatUtil;
import com.earth2me.essentials.utils.StringUtil; import com.earth2me.essentials.utils.StringUtil;
import java.util.List;
import org.bukkit.Server; import org.bukkit.Server;
import java.util.List;
import static com.earth2me.essentials.I18n._;
public class Commandmail extends EssentialsCommand 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))); final String mail = user.getName() + ": " + StringUtil.sanitizeString(FormatUtil.stripFormat(getFinalArg(args, 2)));
if (mail.length() > 1000) 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) if (Math.abs(System.currentTimeMillis() - timestamp) > 60000)
{ {
@@ -70,7 +72,7 @@ public class Commandmail extends EssentialsCommand
mailsPerMinute++; mailsPerMinute++;
if (mailsPerMinute > ess.getSettings().getMailsPerMinute()) 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); u.addMail(mail);
} }

View File

@@ -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]); 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) 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()); final Location loc = new Location(target2.getWorld(), x, y, z, target2.getLocation().getYaw(), target2.getLocation().getPitch());
if (!target2.isTeleportEnabled()) 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]); 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) 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()); final Location loc = new Location(target.getWorld(), x, y, z, target.getLocation().getYaw(), target.getLocation().getPitch());
target.getTeleport().now(loc, false, TeleportCause.COMMAND); target.getTeleport().now(loc, false, TeleportCause.COMMAND);

View File

@@ -38,7 +38,7 @@ public class Commandtppos extends EssentialsCommand
} }
if (x > 30000000 || y > 30000000 || z > 30000000 || x < -30000000 || y < -30000000 || z < -30000000) 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); final Trade charge = new Trade(this.getName(), ess);
charge.isAffordableFor(user); 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) 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())); sender.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));
user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ())); user.sendMessage(_("teleporting", loc.getWorld().getName(), loc.getBlockX(), loc.getBlockY(), loc.getBlockZ()));

View File

@@ -58,7 +58,6 @@ public class Commandweather extends EssentialsCommand
} }
} }
//TODO: Translate these
@Override @Override
protected void run(final Server server, final CommandSource sender, final String commandLabel, final String[] args) throws Exception 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]); final World world = server.getWorld(args[0]);
if (world == null) if (world == null)
{ {
throw new Exception("World named " + args[0] + " not found!"); throw new Exception(_("weatherInvalidWorldWorld", args[0]));
} }
if (args.length > 2) if (args.length > 2)
{ {

View File

@@ -539,4 +539,9 @@ skullChanged=\u00a76Skull changed to \u00a7c{0}.\u00a76.
alphaNames=\u00a74Player names can only contain letters, numbers and underscores. alphaNames=\u00a74Player names can only contain letters, numbers and underscores.
givenSkull=\u00a76You have been given the Skull of \u00a7c{0}\u00a76. givenSkull=\u00a76You have been given the Skull of \u00a7c{0}\u00a76.
noPermissionSkull=\u00a74You do not have permission to modify that Skull. noPermissionSkull=\u00a74You do not have permission to modify that Skull.
invalidSkull=\u00a74Please hold a player Skull. 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}