Localize chat commands and /invite

This commit is contained in:
GJ 2013-01-16 22:13:30 -05:00
parent 5f4c83b6a1
commit 89da8b832f
4 changed files with 11 additions and 10 deletions

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.party; package com.gmail.nossr50.commands.party;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -24,7 +23,7 @@ public class ACommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PlayerProfile profile; PlayerProfile profile;
String usage = ChatColor.RED + "Proper usage is /a <message>"; //TODO: Needs more locale. String usage = LocaleLoader.getString("Commands.Usage.1", new Object[] {"a", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"});
if (CommandHelper.noCommandPermissions(sender, "mcmmo.chat.adminchat")) { if (CommandHelper.noCommandPermissions(sender, "mcmmo.chat.adminchat")) {
return true; return true;
@ -76,7 +75,7 @@ public class ACommand implements CommandExecutor {
} }
message = chatEvent.getMessage(); message = chatEvent.getMessage();
String prefix = ChatColor.AQUA + "{" + ChatColor.WHITE + player.getName() + ChatColor.AQUA + "} "; String prefix = LocaleLoader.getString("Commands.AdminChat.Prefix", new Object[] {player.getName()} );
plugin.getLogger().info("[A]<" + player.getName() + "> " + message); plugin.getLogger().info("[A]<" + player.getName() + "> " + message);
@ -95,7 +94,7 @@ public class ACommand implements CommandExecutor {
} }
message = chatEvent.getMessage(); message = chatEvent.getMessage();
String prefix = ChatColor.AQUA + "{" + ChatColor.WHITE + "*Console*" + ChatColor.AQUA + "} "; String prefix = LocaleLoader.getString("Commands.AdminChat.Prefix", new Object[] {LocaleLoader.getString("Commands.Chat.Console")} );
plugin.getLogger().info("[A]<*Console*> " + message); plugin.getLogger().info("[A]<*Console*> " + message);

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.party; package com.gmail.nossr50.commands.party;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -24,7 +23,7 @@ public class InviteCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
String usage = ChatColor.RED + "Proper usage is /invite <player>"; //TODO: Needs more locale. String usage = LocaleLoader.getString("Commands.Usage.1", new Object[] {"invite", "<" + LocaleLoader.getString("Commands.Usage.Player") + ">"});
if (CommandHelper.noConsoleUsage(sender)) { if (CommandHelper.noConsoleUsage(sender)) {
return true; return true;

View File

@ -1,6 +1,5 @@
package com.gmail.nossr50.commands.party; package com.gmail.nossr50.commands.party;
import org.bukkit.ChatColor;
import org.bukkit.command.Command; import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor; import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender; import org.bukkit.command.CommandSender;
@ -25,7 +24,7 @@ public class PCommand implements CommandExecutor {
@Override @Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) { public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
PlayerProfile profile; PlayerProfile profile;
String usage = ChatColor.RED + "Proper usage is /p <party-name> <message>"; //TODO: Needs more locale. String usage = LocaleLoader.getString("Commands.Usage.2", new Object[] {"p", "<" + LocaleLoader.getString("Commands.Usage.PartyName") + ">", "<" + LocaleLoader.getString("Commands.Usage.Message") + ">"});
if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.party")) { if (CommandHelper.noCommandPermissions(sender, "mcmmo.commands.party")) {
return true; return true;
@ -83,7 +82,7 @@ public class PCommand implements CommandExecutor {
} }
message = chatEvent.getMessage(); message = chatEvent.getMessage();
String prefix = ChatColor.GREEN + "(" + ChatColor.WHITE + player.getName() + ChatColor.GREEN + ") "; String prefix = LocaleLoader.getString("Commands.Party.Chat.Prefix", new Object[] {player.getName()} );
plugin.getLogger().info("[P](" + party.getName() + ")" + "<" + player.getName() + "> " + message); plugin.getLogger().info("[P](" + party.getName() + ")" + "<" + player.getName() + "> " + message);
@ -120,7 +119,7 @@ public class PCommand implements CommandExecutor {
} }
message = chatEvent.getMessage(); message = chatEvent.getMessage();
String prefix = ChatColor.GREEN + "(" + ChatColor.WHITE + "*Console*" + ChatColor.GREEN + ") "; String prefix = LocaleLoader.getString("Commands.Party.Chat.Prefix", new Object[] {LocaleLoader.getString("Commands.Chat.Console")} );
plugin.getLogger().info("[P](" + args[0] + ")" + "<*Console*> " + message); plugin.getLogger().info("[P](" + args[0] + ")" + "<*Console*> " + message);

View File

@ -392,6 +392,7 @@ Commands.AdminChat.Off=Admin Chat only [[RED]]Off
Commands.AdminChat.On=Admin Chat only [[GREEN]]On Commands.AdminChat.On=Admin Chat only [[GREEN]]On
Commands.AdminChat.Prefix=[[AQUA]]{[[WHITE]]{0}[[AQUA]]} Commands.AdminChat.Prefix=[[AQUA]]{[[WHITE]]{0}[[AQUA]]}
Commands.AdminToggle=[[RED]]- Toggle admin chat Commands.AdminToggle=[[RED]]- Toggle admin chat
Commands.Chat.Console=*Console*
Commands.Disabled=[[RED]]This command is disabled. Commands.Disabled=[[RED]]This command is disabled.
Commands.DoesNotExist= [[RED]]Player does not exist in the database! Commands.DoesNotExist= [[RED]]Player does not exist in the database!
Commands.GodMode.Disabled=[[YELLOW]]mcMMO Godmode Disabled Commands.GodMode.Disabled=[[YELLOW]]mcMMO Godmode Disabled
@ -442,6 +443,9 @@ Commands.Stats.Self=YOUR STATS
Commands.Stats=[[RED]]- View your mcMMO stats Commands.Stats=[[RED]]- View your mcMMO stats
Commands.ToggleAbility=[[RED]]- Toggle ability activation with right click Commands.ToggleAbility=[[RED]]- Toggle ability activation with right click
Commands.Usage.1=[[RED]]Proper usage is /{0} {1} Commands.Usage.1=[[RED]]Proper usage is /{0} {1}
Commands.Usage.2=[[RED]]Proper usage is /{0} {1} {2}
Commands.Usage.Message=message
Commands.Usage.PartyName=party-name
Commands.Usage.Player=player Commands.Usage.Player=player
mcMMO.NoInvites=[[RED]]You have no invites at this time mcMMO.NoInvites=[[RED]]You have no invites at this time
mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions. mcMMO.NoPermission=[[DARK_RED]]Insufficient permissions.