[trunk] translations - halfway there

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1416 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
ementalo 2011-05-10 21:52:07 +00:00
parent 04044282ad
commit 07e49c3fbb
19 changed files with 113 additions and 52 deletions

View File

@ -31,7 +31,7 @@ public class Commandclearinventory extends EssentialsCommand
for (Player p : online)
{
p.getInventory().clear();
user.sendMessage("§7Inventory of §c" + p.getDisplayName() + "§7 cleared.");
user.sendMessage(Util.format("inventoryClearedOthers", p.getDisplayName()));
}
return;
}

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
@ -16,6 +17,6 @@ public class Commandessentials extends EssentialsCommand
{
ess.reload();
charge(sender);
sender.sendMessage("§7Essentials Reloaded " + ess.getDescription().getVersion());
sender.sendMessage(Util.format("essentialsReload", ess.getDescription().getVersion()));
}
}

View File

@ -1,5 +1,6 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
@ -16,14 +17,14 @@ public class Commandgc extends EssentialsCommand
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
charge(sender);
sender.sendMessage("Maximum memory: " + (Runtime.getRuntime().maxMemory() / 1024 / 1024) + " MB");
sender.sendMessage("Free memory: " + (Runtime.getRuntime().freeMemory() / 1024 / 1024) + " MB");
sender.sendMessage(Util.format("gcmax", (Runtime.getRuntime().maxMemory() / 1024 / 1024)));
sender.sendMessage(Util.format("gcmin", (Runtime.getRuntime().freeMemory() / 1024 / 1024)));
for (World w : server.getWorlds())
{
sender.sendMessage(
(w.getEnvironment() == World.Environment.NETHER ? "Nether" : "World") + " \"" + w.getName() + "\": "
+ w.getLoadedChunks().length + " chunks, "
+ w.getEntities().size() + " entities");
+ w.getLoadedChunks().length + Util.i18n("gcchunks")
+ w.getEntities().size() + Util.i18n("entities"));
}
}
}

View File

@ -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.command.CommandSender;
import org.bukkit.entity.Player;
@ -34,7 +35,7 @@ public class Commandgod extends EssentialsCommand
return;
}
user.sendMessage("§7God mode " + (user.toggleGodModeEnabled() ? "enabled." : "disabled."));
user.sendMessage(Util.format("godMode", (user.toggleGodModeEnabled()? Util.i18n("godEnabled") : Util.i18n("godDisabled"))));
}
private void godOtherPlayers(Server server, CommandSender sender, String name)
@ -43,8 +44,8 @@ public class Commandgod extends EssentialsCommand
{
User u = ess.getUser(p);
boolean enabled = u.toggleGodModeEnabled();
u.sendMessage("§7God mode " + (enabled ? "enabled." : "disabled."));
sender.sendMessage("§7God mode " + (enabled ? "enabled for " : "disabled for ") + p.getDisplayName() + ".");
u.sendMessage(Util.format("godMode", (enabled ? Util.i18n("godEnabled") : Util.i18n("godDisabled"))));
sender.sendMessage(Util.format("godMode",Util.format(enabled ? Util.i18n("godEnabledFor"): Util.i18n("godDisabledFor"), p.getDisplayName())));
}
}
}

View File

@ -4,6 +4,7 @@ import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.List;
@ -35,7 +36,7 @@ public class Commandheal extends EssentialsCommand
}
charge(user);
user.setHealth(20);
user.sendMessage("§7You have been healed.");
user.sendMessage(Util.i18n("heal"));
}
@Override
@ -54,13 +55,13 @@ public class Commandheal extends EssentialsCommand
List<Player> players = server.matchPlayer(name);
if(players.isEmpty())
{
sender.sendMessage("§cPlayer matching " + name + " not found");
sender.sendMessage(Util.i18n("playerNotFound"));
return;
}
for (Player p : players)
{
p.setHealth(20);
sender.sendMessage("§7Healed " + p.getDisplayName() + ".");
sender.sendMessage(Util.format("healOther", p.getDisplayName()));
}
}
}

View File

@ -42,7 +42,7 @@ public class Commandhelp extends EssentialsCommand
int start = (page - 1) * 9;
int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
user.sendMessage("Page §c" + page + "§f of §c" + pages + "§f:");
user.sendMessage(Util.format("helpPages", page, pages));
for (int i = start; i < lines.size() && i < start + 9; i++)
{
user.sendMessage(lines.get(i));
@ -52,7 +52,7 @@ public class Commandhelp extends EssentialsCommand
@Override
protected void run(Server server, CommandSender sender, String commandLabel, String[] args) throws Exception
{
sender.sendMessage("To view help from the console, type \"?\".");
sender.sendMessage(Util.i18n("helpConsole"));
}
@SuppressWarnings("CallToThreadDumpStack")

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.entity.Player;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
public class Commandhelpop extends EssentialsCommand
@ -28,7 +29,7 @@ public class Commandhelpop extends EssentialsCommand
{
continue;
}
u.sendMessage("§c[HelpOp]§f §7" + user.getDisplayName() + ":§f " + getFinalArg(args, 0));
u.sendMessage(Util.format("helpOp", user.getDisplayName(), getFinalArg(args, 0)));
}
}
}

View File

@ -59,7 +59,7 @@ public class Commandinfo extends EssentialsCommand
}
else
{
sender.sendMessage("File info.txt does not exists.");
sender.sendMessage(Util.i18n("infoFileDoesNotExist"));
return;
}
@ -79,7 +79,7 @@ public class Commandinfo extends EssentialsCommand
int pages = lines.size() / 9 + (lines.size() % 9 > 0 ? 1 : 0);
charge(sender);
sender.sendMessage("Page §c" + page + "§f of §c" + pages + "§f:");
sender.sendMessage(Util.format("infoPages", page, pages ));
for (int i = start; i < lines.size() && i < start + 9; i++)
{
sender.sendMessage(lines.get(i));
@ -91,7 +91,7 @@ public class Commandinfo extends EssentialsCommand
{
if (lines.get(0).startsWith("#"))
{
sender.sendMessage("Select chapter:");
sender.sendMessage(Util.i18n("infoChapter"));
StringBuilder sb = new StringBuilder();
boolean first = true;
for (String string : chapters)
@ -131,7 +131,7 @@ public class Commandinfo extends EssentialsCommand
int pages = end / 9 + (end % 9 > 0 ? 1 : 0);
charge(sender);
sender.sendMessage("Page §c" + page + "§f of §c" + pages + "§f:");
sender.sendMessage(Util.format("infoPages", page, pages ));
for (int i = start; i < end && i < start + 9; i++)
{
sender.sendMessage(lines.get(i));
@ -155,7 +155,7 @@ public class Commandinfo extends EssentialsCommand
if (!bookmarks.containsKey(pageStr.toLowerCase()))
{
sender.sendMessage("Unknown chapter.");
sender.sendMessage(Util.i18n("infoUnknownChapter"));
return;
}
int chapterstart = bookmarks.get(pageStr.toLowerCase()) + 1;
@ -173,7 +173,7 @@ public class Commandinfo extends EssentialsCommand
int pages = (chapterend - chapterstart) / 9 + ((chapterend - chapterstart) % 9 > 0 ? 1 : 0);
charge(sender);
sender.sendMessage("Chapter " + pageStr + ", page §c" + page + "§f of §c" + pages + "§f:");
sender.sendMessage(Util.format("infoChapterPages", pageStr, page , pages));
for (int i = start; i < chapterend && i < start + 9; i++)
{
sender.sendMessage(lines.get(i));

View File

@ -1,6 +1,7 @@
package com.earth2me.essentials.commands;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import java.util.Arrays;
import org.bukkit.Server;
import org.bukkit.inventory.ItemStack;
@ -30,7 +31,7 @@ public class Commandinvsee extends EssentialsCommand
{
invUser.getInventory().setContents(user.getSavedInventory());
user.setSavedInventory(null);
user.sendMessage("Your inventory has been restored.");
user.sendMessage(Util.i18n("invRestored"));
return;
}
@ -45,10 +46,10 @@ public class Commandinvsee extends EssentialsCommand
invUserStack = Arrays.copyOf(invUserStack, userStackLength);
}
if (invUserStack.length > userStackLength) {
throw new Exception("The other users inventory is bigger than yours.");
throw new Exception(Util.i18n("invBigger"));
}
user.getInventory().setContents(invUserStack);
user.sendMessage("You see the inventory of " + invUser.getDisplayName() + ".");
user.sendMessage("Use /invsee to restore your inventory.");
user.sendMessage(Util.format("invSee", invUser.getDisplayName()));
user.sendMessage(Util.i18n("invSeeHelp"));
}
}

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import com.earth2me.essentials.ItemDb;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.inventory.ItemStack;
@ -32,7 +33,7 @@ public class Commanditem extends EssentialsCommand
: (!user.isAuthorized("essentials.itemspawn.exempt")
&& !user.canSpawnItem(stack.getTypeId())))
{
user.sendMessage(ChatColor.RED + "You are not allowed to spawn the item " + itemname);
user.sendMessage(Util.format("cantSpawnItem", itemname));
return;
}
@ -43,13 +44,13 @@ public class Commanditem extends EssentialsCommand
if (stack.getType() == Material.AIR)
{
user.sendMessage(ChatColor.RED + "You can't get air.");
user.sendMessage(Util.format("cantSpawnItem", "Air"));
return;
}
String itemName = stack.getType().name().toLowerCase().replace('_', ' ');
charge(user);
user.sendMessage("§7Giving " + stack.getAmount() + " of " + itemName + " to " + user.getDisplayName() + ".");
user.sendMessage(Util.format("itemSpawn", stack.getAmount(), itemName));
user.getInventory().addItem(stack);
user.updateInventory();
}

View File

@ -4,6 +4,7 @@ import org.bukkit.Location;
import org.bukkit.Server;
import com.earth2me.essentials.TargetBlock;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
public class Commandjump extends EssentialsCommand
@ -31,7 +32,7 @@ public class Commandjump extends EssentialsCommand
}
catch (NullPointerException ex)
{
throw new Exception("That would hurt your computer's brain.", ex);
throw new Exception(Util.i18n("jumpError"), ex);
}
user.canAfford(this);

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import org.bukkit.Server;
import org.bukkit.command.CommandSender;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.ChatColor;
@ -28,11 +29,11 @@ public class Commandkick extends EssentialsCommand
}
catch (Throwable ex)
{
sender.sendMessage(ChatColor.RED + "That player does not exist!");
sender.sendMessage(Util.i18n("playerNotFound"));
return;
}
charge(sender);
u.kickPlayer(args.length > 1 ? getFinalArg(args, 1) : "Kicked from server");
u.kickPlayer(args.length > 1 ? getFinalArg(args, 1) : Util.i18n("kickDefault"));
}
}

View File

@ -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.entity.Player;
@ -25,7 +26,7 @@ public class Commandkickall extends EssentialsCommand
}
else
{
p.kickPlayer(args.length < 1 ? getFinalArg(args, 0) : "Kicked from server");
p.kickPlayer(args.length < 1 ? getFinalArg(args, 0) : Util.i18n("kickDefault"));
}
}
}

View File

@ -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.entity.Player;
@ -24,7 +25,7 @@ public class Commandkill extends EssentialsCommand
for (Player p : server.matchPlayer(args[0]))
{
p.setHealth(0);
sender.sendMessage("§cKilled " + p.getDisplayName() + ".");
sender.sendMessage(Util.format("kill", p.getDisplayName()));
}
}
}

View File

@ -44,12 +44,12 @@ public class Commandkit extends EssentialsCommand
}
else
{
user.sendMessage("§7There are no kits available yet");
user.sendMessage(Util.i18n("noKits"));
}
}
catch (Exception ex)
{
user.sendMessage("§cThere are no valid kits.");
user.sendMessage(Util.i18n("kitError"));
}
}
else
@ -62,7 +62,7 @@ public class Commandkit extends EssentialsCommand
if (!user.isAuthorized("essentials.kit." + kitName))
{
user.sendMessage("§cYou need the §fessentials.kit." + kitName + "§c permission to use that kit.");
user.sendMessage(Util.format("noKitPermission", "essentials.kit." + kitName));
return;
}
@ -100,7 +100,7 @@ public class Commandkit extends EssentialsCommand
}
else
{
user.sendMessage("§cYou can't use that kit again for another " + Util.formatDateDiff(kitTimes.get(kitName)) + ".");
user.sendMessage(Util.format("kitTimed", Util.formatDateDiff(kitTimes.get(kitName))));
return;
}
}
@ -136,7 +136,7 @@ public class Commandkit extends EssentialsCommand
}
if (spew)
{
user.sendMessage("§7Your inventory was full, placing kit on the floor");
user.sendMessage(Util.i18n("kitInvFull"));
}
try
{
@ -147,12 +147,12 @@ public class Commandkit extends EssentialsCommand
{
user.sendMessage(ex.getMessage());
}
user.sendMessage("§7Giving kit " + args[0].toLowerCase() + ".");
user.sendMessage(Util.format("kitGive", args[0].toLowerCase()));
}
catch (Exception ex)
{
user.sendMessage("§cThat kit does not exist or is improperly defined.");
user.sendMessage("§cPerhaps an item is missing a quantity in the configuration?");
user.sendMessage(Util.i18n("kitError2"));
user.sendMessage(Util.i18n("kitErrorHelp"));
}
}
}

View File

@ -2,6 +2,7 @@ package com.earth2me.essentials.commands;
import com.earth2me.essentials.Essentials;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.Server;
import org.bukkit.World;
import org.bukkit.command.CommandSender;
@ -33,18 +34,18 @@ public class Commandlightning extends EssentialsCommand
if (server.matchPlayer(args[0]).isEmpty())
{
sender.sendMessage("§cPlayer not found");
sender.sendMessage(Util.i18n("playerNotFound"));
return;
}
for (Player p : server.matchPlayer(args[0]))
{
sender.sendMessage("§7Smiting " + p.getDisplayName());
sender.sendMessage(Util.format("lightningUse", p.getDisplayName()));
p.getWorld().strikeLightning(p.getLocation());
p.setHealth(p.getHealth() < 5 ? 0 : p.getHealth() - 5);
if (ess.getSettings().warnOnSmite())
{
p.sendMessage("§7You have just been smited");
p.sendMessage(Util.i18n("lightningSmited"));
}
}
if (user != null)

View File

@ -5,6 +5,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.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@ -84,7 +85,7 @@ public class Commandlist extends EssentialsCommand
Collections.sort(users);
StringBuilder onlineUsers = new StringBuilder();
onlineUsers.append("Connected players: ");
onlineUsers.append(Util.i18n("connectedPlayers"));
boolean first = true;
for (User user : users)
{

View File

@ -3,6 +3,7 @@ package com.earth2me.essentials.commands;
import java.util.List;
import org.bukkit.Server;
import com.earth2me.essentials.User;
import com.earth2me.essentials.Util;
import org.bukkit.ChatColor;
import org.bukkit.entity.Player;
@ -22,21 +23,21 @@ public class Commandmail extends EssentialsCommand
List<String> mail = user.getMails();
if (mail.isEmpty())
{
user.sendMessage("§cYou do not have any mail!");
user.sendMessage(Util.i18n("noMail"));
return;
}
for (String s : mail)
{
user.sendMessage(s);
}
user.sendMessage("§cTo mark your mail as read, type §c/mail clear");
user.sendMessage(Util.i18n("mailClear"));
return;
}
if (args.length >= 3 && "send".equalsIgnoreCase(args[0]))
{
if (!user.isAuthorized("essentials.mail.send"))
{
user.sendMessage("§cYou do not have the §fessentials.mail.send§c permission.");
user.sendMessage(Util.i18n("noMailSendPerm"));
return;
}
@ -52,20 +53,20 @@ public class Commandmail extends EssentialsCommand
}
if (u == null)
{
user.sendMessage("§cPlayer " + args[1] + " never was on this server.");
user.sendMessage(Util.format("playerNeverOnServer", args[1]));
return;
}
charge(user);
u.addMail(ChatColor.stripColor(user.getDisplayName()) + ": " + getFinalArg(args, 2));
user.sendMessage("§7Mail sent!");
user.sendMessage(Util.i18n("mailSent"));
return;
}
if (args.length >= 1 && "clear".equalsIgnoreCase(args[0]))
{
user.setMails(null);
user.sendMessage("§7Mail cleared!");
user.sendMessage(Util.i18n("mailCleared"));
return;
}
user.sendMessage("§7Usage: /mail [read|clear|send [to] [message]]");
user.sendMessage(Util.format("usage", "/mail [read|clear|send [to] [message]]"));
}
}

View File

@ -147,3 +147,50 @@ buildAlert = \u00a7cYou are not permitted to build
protectionOwner = \u00a76[EssentialsProtect] Protection owner: {0}
spawnSet = \u00a77Spawn location set for group {0}.
teleportNewPlayerError = Failed to teleport new player
essentialsReload = \u00a77Essentials Reloaded {0}
gcmax = Maximum memory: {0} MB
gcmin = Minimum memory: {0} MB
gcchunks = chunks,
gcentities = entities
godMode = \u00a77God mode {0}.
godEnabled = enabled
godDisabled = disabled
godEnabledFor = enabled for {0}
godDisabledFor = disabled for {0}
heal = \u00a77You have been healed.
healOther = \u00a77Healed {0}.
helpPages = Page \u00a7c {0} \u00a7f of \u00a7c {1} \u00a7f:
helpConsole = To view help from the console, type ?.
helpOp = \u00a7c[HelpOp]\u00a7f \u00a77 {0} :\u00a7f {1}
infoFileDoesNotExist = File info.txt does not exist.
infoPages = Page \u00a7c {0} \u00a7f of \u00a7c {1} \u00a7f:
infoChapter = Select chapter:
infoUnknownChapter = Unknown chapter:
infoChapterPages = Chapter {0} , page \u00a7c {1} \u00a7f of \u00a7c {2} \u00a7f:
invBigger = The other users inventory is bigger than yours.
invRestored = Your inventory has been restored.
invSee = You see the inventory of {0}.
invSeeHelp = Use /invsee to restore your inventory.
cantSpawnItem = \u00a7cYou are not allowed to spawn the item {0}
itemSpawn = \u00a77Giving {0} of {1}
jumpError = That would hurt your computer's brain.
kickDefault = Kicked from server
kill = \u00a77Killed {0}.
noKits = \u00a77There are no kits available yet
kitError = \u00a7cThere are no valid kits.
kitError2 = \u00a7cThat kit does not exist or is improperly defined.
kitErrorHelp = \u00a7cPerhaps an item is missing a quantity in the configuration?
noKitPermission = \u00a7cYou need the \u00a7{0} \u00a7cc permission to use that kit.
kitTimed = \u00a7cYou can't use that kit again for another {0}
kitInvFull = \u00a7cYour inventory was full, placing kit on the floor
kitGive = \u00a77Giving kit {0}.
lightningUse = \u00a77Smiting {0}
lightningSmited = \u00a77You have just been smited
connectedPlayers = Connected players:
noMail = You do not have any mail
mailClear = \u00a7cTo mark your mail as read, type /mail clear
noMailSendPerm = \u00a7cYou do not have the \u00a7fessentials.mail.send\u00a7c permission.
playerNeverOnServer = \u00a7cPlayer {0} was never on this server.
mailSent = \u00a77Mail sent!
mailCleared = \u00a77Mail Cleared!
usage = \u00a7cUsage :