[trunk] Translation of Essentials to other languages. This is just a start, many strings needs to be added.

Console doesn't show umlauts, but in game chat does.
New config property: locale

git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1386 e251c2fe-e539-e718-e476-b85c1f46cddb
This commit is contained in:
snowleo 2011-05-09 02:42:20 +00:00
parent 3195470b1b
commit 0c334bc1e7
5 changed files with 22 additions and 6 deletions

View File

@ -23,7 +23,7 @@ import org.bukkit.plugin.java.*;
public class Essentials extends JavaPlugin
{
public static final String AUTHORS = "Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology.";
public static final String AUTHORS = "Zenexer, ementalo, Aelux, Brettflan, KimKandor, snowleo, ceulemans and Xeology";
public static final int minBukkitBuildVersion = 740;
private static final Logger logger = Logger.getLogger("Minecraft");
private Settings settings;
@ -94,6 +94,7 @@ public class Essentials extends JavaPlugin
confList = new ArrayList<IConf>();
settings = new Settings(this.getDataFolder());
confList.add(settings);
Util.updateLocale(settings.getLocale(), this.getDataFolder());
spawn = new Spawn(getServer(), this.getDataFolder());
confList.add(spawn);
warps = new Warps(getServer(), this.getDataFolder());
@ -171,7 +172,7 @@ public class Essentials extends JavaPlugin
timer = new EssentialsTimer(this);
getScheduler().scheduleSyncRepeatingTask(this, timer, 1, 50);
logger.info("Loaded " + this.getDescription().getName() + " build " + this.getDescription().getVersion() + " maintained by " + AUTHORS);
logger.info(Util.format("loadinfo", this.getDescription().getName(), this.getDescription().getVersion(), AUTHORS));
}
public void onDisable()

View File

@ -494,4 +494,8 @@ public class Settings implements IConf
return config.getBoolean("permission-based-item-spawn", false);
}
public String getLocale()
{
return config.getString("locale", "en_US");
}
}

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 Commandafk extends EssentialsCommand
@ -18,11 +19,11 @@ public class Commandafk extends EssentialsCommand
if (!user.toggleAfk())
{
user.sendMessage("§7You are no longer marked as away.");
server.broadcastMessage("§7" + user.getDisplayName() + " is no longer AFK");
user.sendMessage(Util.i18n("markedAsNotAway"));
server.broadcastMessage(Util.format("userIsNotAway", user.getDisplayName()));
} else {
user.sendMessage("§7You are now marked as away.");
server.broadcastMessage("§7" + user.getDisplayName() + " is now AFK");
user.sendMessage(Util.i18n("markedAsAway"));
server.broadcastMessage(Util.format("userIsAway", user.getDisplayName()));
}
}
}

View File

@ -0,0 +1,5 @@
loadinfo = Loaded {0} build {1} maintained by {2}
markedAsNotAway = \u00a77You are no longer marked as away.
markedAsAway = \u00a77You are now marked as away.
userIsNotAway = {0} is no longer AFK
userIsAway = {0} is now AFK

View File

@ -0,0 +1,5 @@
loadinfo = Plugin {0} Version {1} geladen, erstellt von {2}, \u00fcbersetzt von snowleo\n
markedAsNotAway = \u00a77Du wirst nicht mehr als abwesend angezeigt.
markedAsAway = \u00a77Du wirst als abwesend angezeigt.
userIsNotAway = {0} ist wieder da.
userIsAway = {0} ist abwesend.