Add more localisation

This commit is contained in:
TfT_02 2013-05-02 21:02:12 +02:00
parent 8dab75f3cb
commit f6e9fd9f3a
12 changed files with 40 additions and 29 deletions

View File

@ -4,7 +4,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Set;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -76,7 +75,7 @@ public class PtpCommand implements TabExecutor {
long lastTeleport = mcMMOPlayer.getLastTeleport();
if (!SkillUtils.cooldownOver(lastTeleport * Misc.TIME_CONVERSION_FACTOR, ptpCooldown, player)) {
player.sendMessage(ChatColor.RED + "You need to wait before you can use this again! " + ChatColor.YELLOW + "(" + SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, ptpCooldown, player) + ")"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Item.Generic.Wait", SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, ptpCooldown, player)));
return true;
}
@ -166,7 +165,7 @@ public class PtpCommand implements TabExecutor {
mcMMOPlayer.actualizeTeleportCommenceLocation(teleportingPlayer);
if (warmup > 0) {
teleportingPlayer.sendMessage(ChatColor.GRAY + "Commencing teleport in " + ChatColor.GOLD + "(" + warmup + ")" + ChatColor.GRAY + " seconds, please stand still..."); //TODO Locale!
teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup));
new TeleportationWarmup(mcMMOPlayer, mcMMOTarget).runTaskLater(mcMMO.p, 20 * warmup);
}
else {

View File

@ -8,6 +8,7 @@ import org.bukkit.OfflinePlayer;
import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.party.ShareHandler.ShareMode;
public class Party {
@ -62,25 +63,24 @@ public class Party {
public List<String> getItemShareCategories() {
List<String> shareCategories = new ArrayList<String>();
// TODO Locale the category names!
if (shareLootDrops) {
shareCategories.add("Loot");
shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Loot"));
}
if (shareMiningDrops) {
shareCategories.add("Mining");
shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Mining"));
}
if (shareHerbalismDrops) {
shareCategories.add("Herbalism");
shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Herbalism"));
}
if (shareWoodcuttingDrops) {
shareCategories.add("Woodcutting");
shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Woodcutting"));
}
if (shareMiscDrops) {
shareCategories.add("Misc");
shareCategories.add(LocaleLoader.getString("Party.ItemShare.Category.Misc"));
}
return shareCategories;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.listeners;
import org.bukkit.ChatColor;
import org.bukkit.GameMode;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -377,7 +376,7 @@ public class PlayerListener implements Listener {
// Cancel repairing an enchanted item
if (repairManager.checkConfirmation(blockID, false) && Config.getInstance().getRepairConfirmRequired()) {
UserManager.getPlayer(player).setLastAnvilUse(Repair.repairAnvilId, 0);
player.sendMessage(ChatColor.RED + "Repair cancelled!"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Skills.Cancelled", "Repair"));
}
}
/* SALVAGE CHECKS */
@ -387,7 +386,7 @@ public class PlayerListener implements Listener {
// Cancel salvaging an enchanted item
if (repairManager.checkConfirmation(blockID, false) && Config.getInstance().getRepairConfirmRequired()) {
UserManager.getPlayer(player).setLastAnvilUse(Repair.salvageAnvilId, 0);
player.sendMessage(ChatColor.RED + "Salvage cancelled!"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Skills.Cancelled", "Salvage"));
}
}

View File

@ -7,8 +7,8 @@ import org.bukkit.scheduler.BukkitRunnable;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.database.FlatfileDatabaseManager;
import com.gmail.nossr50.database.SQLDatabaseManager;
public class McrankCommandAsyncTask extends BukkitRunnable {
private final String playerName;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.runnables.items;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;
@ -36,12 +35,12 @@ public class ChimaeraWingWarmup extends BukkitRunnable {
mcMMOPlayer.setTeleportCommenceLocation(null);
if (newLocation.distanceSquared(previousLocation) > 1.0 || !player.getInventory().containsAtLeast(ChimaeraWing.getChimaeraWing(0), 1)) {
player.sendMessage(ChatColor.DARK_RED + "Teleportation canceled!"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Teleport.Cancelled"));
return;
}
if (!ItemUtils.isChimaeraWing(inHand) || inHand.getAmount() < Config.getInstance().getChimaeraUseCost()) {
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", "Chimaera Wings")); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", LocaleLoader.getString("Item.ChimaeraWing.Name")));
return;
}

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.runnables.items;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.scheduler.BukkitRunnable;
@ -44,7 +43,7 @@ public class TeleportationWarmup extends BukkitRunnable {
}
if (newLocation.distanceSquared(previousLocation) > 1.0) {
teleportingPlayer.sendMessage(ChatColor.DARK_RED + "Teleportation canceled!"); //TODO Locale!
teleportingPlayer.sendMessage(LocaleLoader.getString("Teleport.Cancelled"));
return;
}

View File

@ -3,7 +3,6 @@ package com.gmail.nossr50.skills.repair;
import java.util.Map;
import java.util.Map.Entry;
import org.bukkit.ChatColor;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.Sound;
@ -219,11 +218,11 @@ public class RepairManager extends SkillManager {
mcMMOPlayer.actualizeLastAnvilUse(anvilId);
if (anvilId == Repair.repairAnvilId) {
player.sendMessage(ChatColor.GREEN + "Right-click again to confirm " + ChatColor.GOLD + "Repair" + ChatColor.GREEN + ". Left-click to cancel."); //TODO Locale
player.sendMessage(LocaleLoader.getString("Skills.ConfirmOrCancel", "Repair"));
}
if (anvilId == Repair.salvageAnvilId) {
player.sendMessage(ChatColor.GREEN + "Right-click again to confirm " + ChatColor.GOLD + "Salvage" + ChatColor.GREEN + ". Left-click to cancel."); //TODO Locale
player.sendMessage(LocaleLoader.getString("Skills.ConfirmOrCancel", "Salvage"));
}
return false;
}

View File

@ -199,7 +199,7 @@ public class TamingManager extends SkillManager {
}
if (Permissions.renamePets(player)) {
entity.setCustomName(player.getName() + "\'s " + StringUtils.getPrettyEntityTypeString(entity.getType())); //TODO Localize, perhaps in a different language it makes more sense to switch this around
entity.setCustomName(LocaleLoader.getString("Taming.Summon.Name.Format", player.getName(), StringUtils.getPrettyEntityTypeString(entity.getType())));
entity.setCustomNameVisible(true);
}

View File

@ -58,7 +58,7 @@ public final class ChimaeraWing {
}
if (Config.getInstance().getChimaeraCooldown() > 0 && !SkillUtils.cooldownOver(lastTeleport * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player)) {
player.sendMessage(ChatColor.RED + "You need to wait before you can use this again! " + ChatColor.YELLOW + "(" + SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player) + ")"); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Item.Generic.Wait", SkillUtils.calculateTimeLeft(lastTeleport * Misc.TIME_CONVERSION_FACTOR, Config.getInstance().getChimaeraCooldown(), player)));
return;
}
@ -70,7 +70,7 @@ public final class ChimaeraWing {
}
if (amount < Config.getInstance().getChimaeraUseCost()) {
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", "Chimaera Wings")); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Skills.NeedMore", LocaleLoader.getString("Item.ChimaeraWing.Name")));
return;
}
@ -90,7 +90,7 @@ public final class ChimaeraWing {
long warmup = Config.getInstance().getChimaeraWarmup();
if (warmup > 0) {
player.sendMessage(ChatColor.GRAY + "Commencing teleport in " + ChatColor.GOLD + "(" + warmup + ")" + ChatColor.GRAY + " seconds, please stand still..."); //TODO Locale!
player.sendMessage(LocaleLoader.getString("Teleport.Commencing", warmup));
new ChimaeraWingWarmup(mcMMOPlayer).runTaskLater(mcMMO.p, 20 * warmup);
}
else {
@ -128,11 +128,11 @@ public final class ChimaeraWing {
ItemStack itemStack = new ItemStack(ingredient, amount);
ItemMeta itemMeta = itemStack.getItemMeta();
itemMeta.setDisplayName(ChatColor.GOLD + "Chimaera Wing"); //TODO Locale!
itemMeta.setDisplayName(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"));
List<String> itemLore = new ArrayList<String>();
itemLore.add("mcMMO Item");
itemLore.add(ChatColor.GRAY + "Teleports you to your bed."); //TODO Locale!
itemLore.add(LocaleLoader.getString("Item.ChimaeraWing.Lore"));
itemMeta.setLore(itemLore);
itemStack.setItemMeta(itemMeta);

View File

@ -14,6 +14,7 @@ import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.config.mods.CustomArmorConfig;
import com.gmail.nossr50.config.mods.CustomToolConfig;
import com.gmail.nossr50.config.party.ItemWeightConfig;
import com.gmail.nossr50.locale.LocaleLoader;
public class ItemUtils {
private static Config configInstance = Config.getInstance();
@ -700,7 +701,7 @@ public class ItemUtils {
}
ItemMeta itemMeta = is.getItemMeta();
if (itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + "Chimaera Wing")) { //TODO Get localized name
if (itemMeta.hasDisplayName() && itemMeta.getDisplayName().equals(ChatColor.GOLD + LocaleLoader.getString("Item.ChimaeraWing.Name"))) {
return true;
}

View File

@ -14,9 +14,9 @@ import org.bukkit.scoreboard.Objective;
import org.bukkit.scoreboard.Scoreboard;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.database.FlatfileDatabaseManager;
import com.gmail.nossr50.database.SQLDatabaseManager;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.datatypes.database.PlayerStat;
import com.gmail.nossr50.datatypes.player.McMMOPlayer;
import com.gmail.nossr50.datatypes.player.PlayerProfile;

View File

@ -328,6 +328,7 @@ Taming.Skillup=[[YELLOW]]Taming skill increased by {0}. Total ({1})
Taming.Summon.Complete=[[GREEN]]Summoning complete
Taming.Summon.Fail.Ocelot=[[RED]]You have too many ocelots nearby to summon any more.
Taming.Summon.Fail.Wolf=[[RED]]You have too many wolves nearby to summon any more.
Taming.Summon.Name.Format={0}\'s {1}
#UNARMED
Unarmed.Ability.Berserk.Length=[[RED]]Berserk Length: [[YELLOW]]{0}s
@ -567,6 +568,11 @@ Party.ShareMode.Equal=EQUAL
Party.ShareMode.Random=RANDOM
Party.ExpShare.Disabled=[[RED]]Party experience sharing is disabled.
Party.ItemShare.Disabled=[[RED]]Party item sharing is disabled.
Party.ItemShare.Category.Loot=Loot
Party.ItemShare.Category.Mining=Mining
Party.ItemShare.Category.Herbalism=Herbalism
Party.ItemShare.Category.Woodcutting=Woodcutting
Party.ItemShare.Category.Misc=Misc
##xp
Commands.XPGain.Acrobatics=Falling
@ -631,8 +637,15 @@ Inspect.TooFar=[[RED]]You are too far away to inspect that player!
#ITEMS
Item.ChimaeraWing.Fail=**CHIMAERA WING FAILED!**
Item.ChimaeraWing.Pass=**CHIMAERA WING**
Item.ChimaeraWing.Name=Chimaera Wing
Item.ChimaeraWing.Lore=[[GRAY]]Teleports you to your bed.
Item.Generic.Wait=[[RED]]You need to wait before you can use this again! [[YELLOW]]({0}s)
Item.Injured.Wait=You were injured recently and must wait to use this. [[YELLOW]]({0}s)
#TELEPORTATION
Teleport.Commencing=[[GRAY]]Commencing teleport in [[GOLD]]({0}) [[GRAY]]seconds, please stand still...
Teleport.Cancelled=[[DARK_RED]]Teleportation canceled!
#SKILLS
Skills.Child=[[GOLD]](CHILD SKILL)
Skills.Disarmed=[[DARK_RED]]You have been disarmed!
@ -641,6 +654,8 @@ Skills.NeedMore=[[DARK_RED]]You need more [[GRAY]]{0}
Skills.Parents = PARENTS
Skills.Stats=[[YELLOW]]{0}[[GREEN]]{1}[[DARK_AQUA]] XP([[GRAY]]{2}[[DARK_AQUA]]/[[GRAY]]{3}[[DARK_AQUA]])
Skills.TooTired=[[RED]]You are too tired to use that ability again. [[YELLOW]]({0}s)
Skills.Cancelled=[[RED]]{0} cancelled!
Skills.ConfirmOrCancel=[[GREEN]]Right-click again to confirm [[GOLD]]{0} [[GREEN]]. Left-click to cancel.
#STATISTICS
Stats.Header.Combat=[[GOLD]]-=COMBAT SKILLS=-