Internationalized command

This commit is contained in:
Carlos 2019-08-28 02:49:14 +02:00
parent aa6edfd0f0
commit ca33489af1
4 changed files with 23 additions and 7 deletions

View File

@ -30,4 +30,9 @@ login-failed-console = [WebConsole] Password incorrect while login from {0}
players-message = Connected {0} players for a maximum of {1}
# RamUsageCommand.java
ram-usage-message = {0} free, {1} used, {2} maximum memory
ram-usage-message = {0} free, {1} used, {2} maximum memory
# WebConsoleCommand.java
webconsole-version = WebConsole version {0}.
webconsole-no-connections = There are no logged in WebConsole connections now.
webconsole-active-connections = Connected to WebConsole from:

View File

@ -27,7 +27,12 @@ login-failed-message = Incorrect password, try again
login-failed-console = [WebConsole] Password incorrect while login from {0}
# PlayersCommand.java
players-message = Actualmente conectados {0} jugadores de un máximo de {1}
players-message = Connected {0} players for a maximum of {1}
# RamUsageCommand.java
ram-usage-message = {0} free, {1} used, {2} maximum memory
ram-usage-message = {0} free, {1} used, {2} maximum memory
# WebConsoleCommand.java
webconsole-version = WebConsole version {0}.
webconsole-no-connections = There are no logged in WebConsole connections now.
webconsole-active-connections = Connected to WebConsole from:

View File

@ -30,4 +30,9 @@ login-failed-console = [WebConsole] Contrase
players-message = Actualmente conectados {0} jugadores de un máximo de {1}
# RamUsageCommand.java
ram-usage-message = Memoria: {0} libre, {1} usada, {2} maxima
ram-usage-message = Memoria: {0} libre, {1} usada, {2} maxima
# WebConsoleCommand.java
webconsole-version = WebConsole version {0}.
webconsole-no-connections = No hay ninguna conexión activa a WebConsole en este momento.
webconsole-active-connections = Conectado a WebConsole desde:

View File

@ -7,6 +7,7 @@ import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import com.mesacarlos.webconsole.util.Internationalization;
import com.mesacarlos.webconsole.util.LoginManager;
public class WebConsoleCommand implements CommandExecutor {
@ -20,13 +21,13 @@ public class WebConsoleCommand implements CommandExecutor {
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
StringBuilder msg = new StringBuilder();
msg.append("WebConsole version " + version + ".\n");
msg.append(Internationalization.getPhrase("webconsole-version", version) + ".\n");
ArrayList<InetSocketAddress> connections = LoginManager.getInstance().getLoggedInUsers();
if (connections.isEmpty()) {
msg.append("There are no logged in WebConsole connections now.");
msg.append(Internationalization.getPhrase("webconsole-no-connections"));
} else {
msg.append("Connected to WebConsole from:\n");
msg.append(Internationalization.getPhrase("webconsole-active-connections") + "\n");
for (int i = 0; i < connections.size(); i++) {
InetSocketAddress connection = connections.get(i);
msg.append(connection.toString());