Localize /mmoedit, /mmoupdate, and /mcpurge

This commit is contained in:
GJ
2013-01-16 23:31:28 -05:00
parent 89da8b832f
commit ea7fee2a53
6 changed files with 31 additions and 11 deletions

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.general;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -22,7 +21,7 @@ public class MmoeditCommand implements CommandExecutor {
int newValue;
SkillType skill;
String skillName;
String usage = ChatColor.RED + "Proper usage is /mmoedit [player] <skill> <level>"; //TODO: Needs more locale.
String usage = LocaleLoader.getString("Commands.Usage.3", new Object[] {"mmoedit", "[" + LocaleLoader.getString("Commands.Usage.Player") + "]", "<" + LocaleLoader.getString("Commands.Usage.Skill") + ">", "<" + LocaleLoader.getString("Commands.Usage.Level") + ">" });
if (CommandHelper.noCommandPermissions(sender, "mcmmo.tools.mmoedit")) {
return true;
@ -50,7 +49,7 @@ public class MmoeditCommand implements CommandExecutor {
}
profile.modifySkill(skill, newValue);
sender.sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", new Object[] {skillName, newValue}));
}
else {
sender.sendMessage(usage);
@ -94,8 +93,8 @@ public class MmoeditCommand implements CommandExecutor {
}
profile.modifySkill(skill, newValue);
mcmmoPlayer.getPlayer().sendMessage(ChatColor.GREEN + "Your level in " + skillName + " was set to " + newValue + "!"); //TODO: Needs more locale.
sender.sendMessage(ChatColor.RED + skillName + " has been modified for " + args[0] + "."); //TODO: Use locale
mcmmoPlayer.getPlayer().sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.1", new Object[] {skillName, newValue}));
sender.sendMessage(LocaleLoader.getString("Commands.mmoedit.Modified.2", new Object[] {skillName, args[0]}));
}
else {
profile = new PlayerProfile(args[0], false); //Temporary Profile

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.general;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
@ -9,6 +8,7 @@ import org.bukkit.entity.Player;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.runnables.SQLConversionTask;
import com.gmail.nossr50.util.Users;
@ -25,7 +25,7 @@ public class MmoupdateCommand implements CommandExecutor {
return true;
}
sender.sendMessage(ChatColor.GRAY + "Starting conversion..."); //TODO: Needs more locale.
sender.sendMessage(LocaleLoader.getString("Commands.mmoupdate.Start"));
Users.clearAll();
convertToMySQL();
@ -33,7 +33,7 @@ public class MmoupdateCommand implements CommandExecutor {
Users.addUser(x);
}
sender.sendMessage(ChatColor.GREEN + "Conversion finished!"); //TODO: Needs more locale.
sender.sendMessage(LocaleLoader.getString("Commands.mmoupdate.Finish"));
return true;
}

View File

@ -1,12 +1,13 @@
package com.gmail.nossr50.commands.mc;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.gmail.nossr50.mcMMO;
import com.gmail.nossr50.commands.CommandHelper;
import com.gmail.nossr50.config.Config;
import com.gmail.nossr50.locale.LocaleLoader;
import com.gmail.nossr50.util.Database;
public class McpurgeCommand implements CommandExecutor{
@ -29,7 +30,7 @@ public class McpurgeCommand implements CommandExecutor{
//TODO: Make this work for Flatfile data.
}
sender.sendMessage(ChatColor.GREEN + "The database was successfully purged!"); //TODO: Locale)
sender.sendMessage(LocaleLoader.getString("Commands.mcpurge.Success"));
return true;
}
}