From 0c334bc1e719ba0157905c44324eb2c3cd3bab9b Mon Sep 17 00:00:00 2001 From: snowleo Date: Mon, 9 May 2011 02:42:20 +0000 Subject: [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 --- Essentials/src/com/earth2me/essentials/Essentials.java | 5 +++-- Essentials/src/com/earth2me/essentials/Settings.java | 4 ++++ Essentials/src/com/earth2me/essentials/commands/Commandafk.java | 9 +++++---- Essentials/src/messages.properties | 5 +++++ Essentials/src/messages_de.properties | 5 +++++ 5 files changed, 22 insertions(+), 6 deletions(-) create mode 100644 Essentials/src/messages.properties create mode 100644 Essentials/src/messages_de.properties diff --git a/Essentials/src/com/earth2me/essentials/Essentials.java b/Essentials/src/com/earth2me/essentials/Essentials.java index 1a21f5b7b..725233cdf 100644 --- a/Essentials/src/com/earth2me/essentials/Essentials.java +++ b/Essentials/src/com/earth2me/essentials/Essentials.java @@ -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(); 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() diff --git a/Essentials/src/com/earth2me/essentials/Settings.java b/Essentials/src/com/earth2me/essentials/Settings.java index a394bcbdb..58dfbcee5 100644 --- a/Essentials/src/com/earth2me/essentials/Settings.java +++ b/Essentials/src/com/earth2me/essentials/Settings.java @@ -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"); + } } diff --git a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java index 7affce5d6..a222f9c0b 100644 --- a/Essentials/src/com/earth2me/essentials/commands/Commandafk.java +++ b/Essentials/src/com/earth2me/essentials/commands/Commandafk.java @@ -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())); } } } diff --git a/Essentials/src/messages.properties b/Essentials/src/messages.properties new file mode 100644 index 000000000..b54dfa64c --- /dev/null +++ b/Essentials/src/messages.properties @@ -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 \ No newline at end of file diff --git a/Essentials/src/messages_de.properties b/Essentials/src/messages_de.properties new file mode 100644 index 000000000..675ec1e0d --- /dev/null +++ b/Essentials/src/messages_de.properties @@ -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. \ No newline at end of file -- cgit v1.2.3