Update translation keys to fix issues 648 677

fix issues 648 677
This commit is contained in:
Mateoust 2022-05-09 19:05:03 +08:00 committed by Melledy
parent e6cf27056f
commit a63d87b0bc
6 changed files with 13 additions and 12 deletions

View File

@ -150,7 +150,7 @@ public final class CommandMap {
int uid = Integer.parseInt(targetUidStr);
targetPlayer = Grasscutter.getGameServer().getPlayerByUid(uid);
if (targetPlayer == null) {
CommandHandler.sendMessage(player, translate("commands.generic.execution.player_exist_offline_error"));
CommandHandler.sendMessage(player, translate("commands.execution.player_exist_offline_error"));
} else {
targetPlayerIds.put(playerId, uid);
CommandHandler.sendMessage(player, translate("commands.execution.set_target", targetUidStr));
@ -178,7 +178,7 @@ public final class CommandMap {
int uid = Integer.parseInt(arg);
targetPlayer = Grasscutter.getGameServer().getPlayerByUid(uid);
if (targetPlayer == null) {
CommandHandler.sendMessage(player, translate("commands.generic.execution.player_exist_offline_error"));
CommandHandler.sendMessage(player, translate("commands.execution.player_exist_offline_error"));
return;
}
break;
@ -194,7 +194,7 @@ public final class CommandMap {
if (targetPlayerIds.containsKey(playerId)) {
targetPlayer = Grasscutter.getGameServer().getPlayerByUid(targetPlayerIds.get(playerId)); // We check every time in case the target goes offline after being targeted
if (targetPlayer == null) {
CommandHandler.sendMessage(player, translate("commands.generic.execution.player_exist_offline_error"));
CommandHandler.sendMessage(player, translate("commands.execution.player_exist_offline_error"));
return;
}
} else {

View File

@ -31,11 +31,12 @@ public final class ChangeSceneCommand implements CommandHandler {
}
boolean result = targetPlayer.getWorld().transferPlayerToScene(targetPlayer, sceneId, targetPlayer.getPos());
CommandHandler.sendMessage(sender, translate("commands.changescene.result", Integer.toString(sceneId)));
if (!result) {
CommandHandler.sendMessage(sender, translate("commands.changescene.exists_error"));
return;
}
CommandHandler.sendMessage(sender, translate("commands.changescene.success", Integer.toString(sceneId)));
} catch (Exception e) {
CommandHandler.sendMessage(sender, translate("commands.execution.argument_error"));
}

View File

@ -9,7 +9,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate;
@Command(label = "resetshop", usage = "resetshop", permission = "server.resetshop", permissionTargeted = "server.resetshop.others", description = "commands.status.description")
@Command(label = "resetshop", usage = "resetshop", permission = "server.resetshop", permissionTargeted = "server.resetshop.others", description = "commands.resetshop.description")
public final class ResetShopLimitCommand implements CommandHandler {
@Override

View File

@ -175,7 +175,7 @@ public final class SetStatsCommand implements CommandHandler {
@Override
public void execute(Player sender, Player targetPlayer, List<String> args) {
String syntax = sender == null ? translate("commands.setStats.usage_console") : translate("commands.setStats.ingame");
String syntax = sender == null ? translate("commands.setStats.usage_console") : translate("commands.setStats.usage_ingame");
String usage = syntax + translate("commands.setStats.help_message");
String statStr;
String valueStr;

View File

@ -46,13 +46,13 @@ public final class SpawnCommand implements CommandHandler {
try {
amount = Integer.parseInt(args.get(1));
} catch (NumberFormatException ignored) {
CommandHandler.sendMessage(sender, translate("commands.generic.error.amount"));
CommandHandler.sendMessage(sender, translate("commands.generic.invalid.amount"));
} // Fallthrough
case 1:
try {
id = Integer.parseInt(args.get(0));
} catch (NumberFormatException ignored) {
CommandHandler.sendMessage(sender, translate("commands.generic.error.entityId"));
CommandHandler.sendMessage(sender, translate("commands.generic.invalid.entityId"));
}
break;
default:
@ -64,7 +64,7 @@ public final class SpawnCommand implements CommandHandler {
GadgetData gadgetData = GameData.getGadgetDataMap().get(id);
ItemData itemData = GameData.getItemDataMap().get(id);
if (monsterData == null && gadgetData == null && itemData == null) {
CommandHandler.sendMessage(sender, translate("commands.generic.error.entityId"));
CommandHandler.sendMessage(sender, translate("commands.generic.invalid.entityId"));
return;
}
Scene scene = targetPlayer.getScene();

View File

@ -10,7 +10,7 @@ import java.util.List;
import static emu.grasscutter.utils.Language.translate;
@Command(label = "unlocktower", usage = "unlocktower", aliases = {"ut"},
description = "Unlock all levels of tower", permission = "player.tower")
description = "commands.unlocktower.description", permission = "player.tower")
public class UnlockTowerCommand implements CommandHandler {
@Override
@ -21,7 +21,7 @@ public class UnlockTowerCommand implements CommandHandler {
unlockFloor(sender, sender.getServer().getTowerScheduleManager()
.getScheduleFloors());
CommandHandler.sendMessage(sender, translate("commands.tower.unlock_done"));
CommandHandler.sendMessage(sender, translate("commands.unlocktower.success"));
}
public void unlockFloor(Player player, List<Integer> floors){