More translation stuff

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1469 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-14 23:30:56 +00:00
parent 848a34d736
commit 798cb319f9
8 changed files with 61 additions and 23 deletions

View File

@ -30,7 +30,7 @@ public class Commandthunder extends EssentialsCommand
world.setThundering(setThunder ? true : false);
world.setThunderDuration(Integer.parseInt(args[1]) * 20);
user.sendMessage(Util.format("thunderDuration", (setThunder ? Util.i18n("enabled") : Util.i18n("disabled")), Util.i18n("for"), Util.i18n("seconds")));
user.sendMessage(Util.format("thunderDuration", (setThunder ? Util.i18n("enabled") : Util.i18n("disabled")), Integer.parseInt(args[1])));
}
else

View File

@ -3,8 +3,8 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
public class Commandtime extends EssentialsCommand
@ -39,7 +39,7 @@ public class Commandtime extends EssentialsCommand
setWorldTime(world, args[0]);
}
sender.sendMessage("Time set in all worlds.");
sender.sendMessage(Util.i18n("timeSet"));
}
private void setWorldTime(World world, String timeString) throws Exception
@ -56,6 +56,6 @@ public class Commandtime extends EssentialsCommand
world.setTime(time + 37700);
return;
}
throw new Exception("/time only supports day/night.");
throw new Exception(Util.i18n("onlyDayNight"));
}
}

View File

@ -26,7 +26,7 @@ public class Commandtogglejail extends EssentialsCommand
if (p.isAuthorized("essentials.jail.exempt"))
{
sender.sendMessage("§cYou may not jail that person");
sender.sendMessage(Util.i18n("mayNotJail"));
return;
}
@ -34,7 +34,7 @@ public class Commandtogglejail extends EssentialsCommand
{
charge(sender);
p.setJailed(true);
p.sendMessage("§7You have been jailed");
p.sendMessage(Util.i18n("userJailed"));
p.setJail(null);
Essentials.getJail().sendToJail(p, args[1]);
p.setJail(args[1]);
@ -45,7 +45,9 @@ public class Commandtogglejail extends EssentialsCommand
timeDiff = Util.parseDateDiff(time, true);
p.setJailTimeout(timeDiff);
}
sender.sendMessage("§7Player " + p.getName() + " jailed" + (timeDiff > 0 ? " for" + Util.formatDateDiff(timeDiff) : "") + ".");
sender.sendMessage((timeDiff > 0
? Util.format("playerJailedFor", p.getName(), Util.formatDateDiff(timeDiff))
: Util.format("playerJailed", p.getName())));
return;
}

View File

@ -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 Commandtop extends EssentialsCommand
@ -20,6 +21,6 @@ public class Commandtop extends EssentialsCommand
int topY = user.getWorld().getHighestBlockYAt(topX, topZ);
charge(user);
user.getTeleport().teleport(new Location(user.getWorld(), user.getLocation().getX(), topY + 1, user.getLocation().getZ()), this.getName());
user.sendMessage("§7Teleporting to top.");
user.sendMessage(Util.i18n("teleportTop"));
}
}

View File

@ -1,7 +1,9 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Console;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.command.CommandSender;
@ -24,9 +26,9 @@ public class Commandtp 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.sendMessage("§7Teleporting...");
user.sendMessage(Util.i18n("teleporting"));
user.canAfford(this);
user.getTeleport().teleport(p, this.getName());
break;
@ -36,12 +38,12 @@ public class Commandtp extends EssentialsCommand
{
throw new Exception("You need access to /tpohere to teleport other players.");
}
user.sendMessage("§7Teleporting...");
user.sendMessage(Util.i18n("teleporting"));
charge(user);
User target = getPlayer(server, args, 0);
User toPlayer = getPlayer(server, args, 1);
target.getTeleport().now(toPlayer);
target.sendMessage("§7" + user.getDisplayName() + "§7 teleported you to " + toPlayer.getDisplayName() + "§7.");
target.sendMessage(Util.format("teleportAtoB", user.getDisplayName(), toPlayer.getDisplayName()));
break;
}
}
@ -54,10 +56,10 @@ public class Commandtp extends EssentialsCommand
throw new NotEnoughArgumentsException();
}
sender.sendMessage("§7Teleporting...");
sender.sendMessage(Util.i18n("teleporting"));
User target = getPlayer(server, args, 0);
User toPlayer = getPlayer(server, args, 1);
target.getTeleport().now(toPlayer);
target.sendMessage("§7{Console}§7 teleported you to " + toPlayer.getDisplayName() + "§7.");
target.sendMessage(Util.format("teleportAtoB", Console.NAME, toPlayer.getDisplayName()));
}
}

View File

@ -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 Commandtpa extends EssentialsCommand
@ -22,13 +23,13 @@ public class Commandtpa 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()));
}
player.charge(this);
p.requestTeleport(player, false);
p.sendMessage("§c" + player.getDisplayName() + "§c has requested to teleport to you.");
p.sendMessage("§7To teleport, type §c/tpaccept§7.");
p.sendMessage("§7To deny this request, type §c/tpdeny§7.");
player.sendMessage("§7Request sent to " + p.getDisplayName() + "§7.");
p.sendMessage(Util.format("teleportRequest", player.getDisplayName()));
p.sendMessage(Util.i18n("typeTpaccept"));
p.sendMessage(Util.i18n("typeTpdeny"));
player.sendMessage(Util.format("requestSent", p.getDisplayName()));
}
}

View File

@ -242,8 +242,24 @@ sheepMalformedColor = Malformed color.
suicideMessage = \u00a77Goodbye Cruel World...
suicideSuccess = \u00a77{0} took their own life
tempBanned = Temporarily banned from server for {0}
thunderDuration = You {0} thunder in your world {1}
thunderDuration = You {0} thunder in your world for {1} seconds.
thunder = You {0} thunder in your world
deleteFileError = Could not delete file: {0}
userDoesNotExist = The user {0} does not exist.
negativeBalanceError = User is not allowed to have a negative balance.
negativeBalanceError = User is not allowed to have a negative balance.
timeSet = Time set in all worlds.
onlyDayNight = /time only supports day/night.
mayNotJail = \u00a7cYou may not jail that person
userJailed = \u00a77You have been jailed
playerJailed = \u00a77Player {0} jailed.
playerJailedFor = \u00a77Player {0} jailed for {1}.
playerInJail = \u00a7cPlayer is already in jail {0}.
teleportTop = \u00a77Teleporting to top.
teleporting = \u00a77Teleporting...
teleportDisabled = {0} has teleportation disabled.
needTpohere = You need access to /tpohere to teleport other players.
teleportAtoB = \u00c2\u00a77{0}\u00c2\u00a77 teleported you to {1}\u00c2\u00a77.
teleportRequest = \u00c2\u00a7c{0}\u00c2\u00a7c has requested to teleport to you.
typeTpaccept = \u00c2\u00a77To teleport, type \u00c2\u00a7c/tpaccept\u00c2\u00a77.
typeTpdeny = \u00c2\u00a77To deny this request, type \u00c2\u00a7c/tpdeny\u00c2\u00a77.
requestSent = \u00c2\u00a77Request sent to {0}\u00a77.

View File

@ -242,8 +242,24 @@ sheepMalformedColor = Malformed color.
suicideMessage = \u00a77Goodbye Cruel World...
suicideSuccess = \u00a77{0} took their own life
tempBanned = Temporarily banned from server for {0}
thunderDuration = You {0} thunder in your world {1}
thunderDuration = You {0} thunder in your world for {1} seconds.
thunder = You {0} thunder in your world
deleteFileError = Could not delete file: {0}
userDoesNotExist = The user {0} does not exist.
negativeBalanceError = User is not allowed to have a negative balance.
negativeBalanceError = User is not allowed to have a negative balance.
timeSet = Time set in all worlds.
onlyDayNight = /time only supports day/night.
mayNotJail = \u00a7cYou may not jail that person
userJailed = \u00a77You have been jailed
playerJailed = \u00a77Player {0} jailed.
playerJailedFor = \u00a77Player {0} jailed for {1}.
playerInJail = \u00a7cPlayer is already in jail {0}.
teleportTop = \u00a77Teleporting to top.
teleporting = \u00a77Teleporting...
teleportDisabled = {0} has teleportation disabled.
needTpohere = You need access to /tpohere to teleport other players.
teleportAtoB = \u00c2\u00a77{0}\u00c2\u00a77 teleported you to {1}\u00c2\u00a77.
teleportRequest = \u00c2\u00a7c{0}\u00c2\u00a7c has requested to teleport to you.
typeTpaccept = \u00c2\u00a77To teleport, type \u00c2\u00a7c/tpaccept\u00c2\u00a77.
typeTpdeny = \u00c2\u00a77To deny this request, type \u00c2\u00a7c/tpdeny\u00c2\u00a77.
requestSent = \u00c2\u00a77Request sent to {0}\u00a77.