From 2d2dc5d0a822cb621cc8ada9b6b8d51c1b49c8fb Mon Sep 17 00:00:00 2001 From: tester233 <1804830236@qq.com> Date: Sun, 22 May 2022 22:20:13 +0800 Subject: [PATCH] Update translation keys --- .../grasscutter/command/commands/KillAllCommand.java | 8 ++++---- .../command/commands/KillCharacterCommand.java | 7 ++++++- .../command/commands/ResetShopLimitCommand.java | 2 +- src/main/resources/languages/en-US.json | 3 ++- src/main/resources/languages/pl-PL.json | 6 ++++-- src/main/resources/languages/zh-CN.json | 11 ++++++----- src/main/resources/languages/zh-TW.json | 3 ++- 7 files changed, 25 insertions(+), 15 deletions(-) diff --git a/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java b/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java index 9ed237d00..6361a726f 100644 --- a/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/KillAllCommand.java @@ -12,7 +12,7 @@ import java.util.List; import static emu.grasscutter.utils.Language.translate; -@Command(label = "killall", usage = "killall [sceneId]", permission = "server.killall", permissionTargeted = "server.killall.others", description = "commands.kill.description") +@Command(label = "killall", usage = "killall [sceneId]", permission = "server.killall", permissionTargeted = "server.killall.others", description = "commands.killall.description") public final class KillAllCommand implements CommandHandler { @Override @@ -26,14 +26,14 @@ public final class KillAllCommand implements CommandHandler { scene = targetPlayer.getWorld().getSceneById(Integer.parseInt(args.get(0))); break; default: - CommandHandler.sendMessage(sender, translate(sender, "commands.kill.usage")); + CommandHandler.sendMessage(sender, translate(sender, "commands.killall.usage")); return; } } catch (NumberFormatException ignored) { CommandHandler.sendMessage(sender, translate(sender, "commands.execution.argument_error")); } if (scene == null) { - CommandHandler.sendMessage(sender, translate(sender, "commands.kill.scene_not_found_in_player_world")); + CommandHandler.sendMessage(sender, translate(sender, "commands.killall.scene_not_found_in_player_world")); return; } @@ -43,6 +43,6 @@ public final class KillAllCommand implements CommandHandler { .filter(entity -> entity instanceof EntityMonster) .toList(); toKill.forEach(entity -> sceneF.killEntity(entity, 0)); - CommandHandler.sendMessage(sender, translate(sender, "commands.kill.kill_monsters_in_scene", Integer.toString(toKill.size()), Integer.toString(scene.getId()))); + CommandHandler.sendMessage(sender, translate(sender, "commands.killall.kill_monsters_in_scene", Integer.toString(toKill.size()), Integer.toString(scene.getId()))); } } diff --git a/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java b/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java index fcd03ba1f..573fb9733 100644 --- a/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/KillCharacterCommand.java @@ -13,11 +13,16 @@ import java.util.List; import static emu.grasscutter.utils.Language.translate; -@Command(label = "killcharacter", usage = "killcharacter", aliases = {"suicide", "kill"}, permission = "player.killcharacter", permissionTargeted = "player.killcharacter.others", description = "commands.killCharacter.description") +@Command(label = "killcharacter", usage = "killcharacter [playerID]", aliases = {"suicide", "kill"}, permission = "player.killcharacter", permissionTargeted = "player.killcharacter.others", description = "commands.killCharacter.description") public final class KillCharacterCommand implements CommandHandler { @Override public void execute(Player sender, Player targetPlayer, List args) { + if (args.isEmpty()) { + CommandHandler.sendMessage(sender, translate(sender, "commands.killCharacter.usage")); + return; + } + EntityAvatar entity = targetPlayer.getTeamManager().getCurrentAvatarEntity(); entity.setFightProperty(FightProperty.FIGHT_PROP_CUR_HP, 0f); // Packets diff --git a/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java b/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java index 37f7a143d..baf65ad60 100644 --- a/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java +++ b/src/main/java/emu/grasscutter/command/commands/ResetShopLimitCommand.java @@ -21,6 +21,6 @@ public final class ResetShopLimitCommand implements CommandHandler { targetPlayer.getShopLimit().forEach(x -> x.setNextRefreshTime(0)); targetPlayer.save(); - CommandHandler.sendMessage(sender, translate(sender, "commands.status.success")); + CommandHandler.sendMessage(sender, translate(sender, "commands.resetShopLimit.success")); } } diff --git a/src/main/resources/languages/en-US.json b/src/main/resources/languages/en-US.json index c65bf3db0..4e5c7d8d3 100644 --- a/src/main/resources/languages/en-US.json +++ b/src/main/resources/languages/en-US.json @@ -192,7 +192,7 @@ "server_kick_player": "Kicking player [%s:%s]...", "description": "Kicks the specified player from the server (WIP)" }, - "kill": { + "killall": { "usage": "Usage: killall [playerUID] [sceneID]", "scene_not_found_in_player_world": "Scene not found in player world.", "kill_monsters_in_scene": "Killing %s monsters in scene %s.", @@ -246,6 +246,7 @@ }, "resetShopLimit": { "usage": "Usage: /resetshop ", + "success": "Reset complete.", "description": "Reset target player's shop refresh time" }, "sendMail": { diff --git a/src/main/resources/languages/pl-PL.json b/src/main/resources/languages/pl-PL.json index 401325f0b..8d1ed5114 100644 --- a/src/main/resources/languages/pl-PL.json +++ b/src/main/resources/languages/pl-PL.json @@ -170,7 +170,7 @@ "player_kick_player": "Gracz [%s:%s] wyrzucił gracza [%s:%s]", "server_kick_player": "Wyrzucono gracza [%s:%s]" }, - "kill": { + "killall": { "usage": "Użycie: killall [UID gracza] [ID sceny]", "scene_not_found_in_player_world": "Scena nie znaleziona w świecie gracza", "kill_monsters_in_scene": "Zabito %s potworów w scenie %s" @@ -202,7 +202,9 @@ "success": "Konstelacje dla %s zostały zresetowane. Proszę zalogować się ponownie aby zobaczyć zmiany." }, "resetShopLimit": { - "usage": "Użycie: /resetshop " + "usage": "Użycie: /resetshop ", + "success": "Reset complete.", + "description": "Reset target player's shop refresh time" }, "sendMail": { "usage": "Użycie: `/sendmail [id szablonu]`", diff --git a/src/main/resources/languages/zh-CN.json b/src/main/resources/languages/zh-CN.json index 95c2b8137..759bab550 100644 --- a/src/main/resources/languages/zh-CN.json +++ b/src/main/resources/languages/zh-CN.json @@ -19,7 +19,7 @@ "authentication": { "default_unable_to_verify": "[Authentication] 称为 verifyUser 的方法在默认验证程序中不可用" }, - "no_commands_error": "此命令不适用于 Dispatch-only 模式", + "no_commands_error": "仅 Dispatch 模式不支持使用命令", "unhandled_request_error": "[Dispatch] 潜在的未处理请求:%s %s", "account": { "login_attempt": "[Dispatch] 客户端 %s 正在尝试登录", @@ -49,7 +49,7 @@ "error": "发生了一个错误。", "welcome": "欢迎使用 Grasscutter!珍惜这段美妙的旅途吧!", "run_mode_error": "无效的服务器运行模式:%s。", - "run_mode_help": "服务器运行模式必须为 HYBRID、DISPATCH_ONLY 或 GAME_ONLY。Grasscutter 启动失败...", + "run_mode_help": "服务器运行模式必须为 'HYBRID'(混合)、'DISPATCH_ONLY'(仅 Dispatch) 或 'GAME_ONLY'(仅游戏)。Grasscutter 启动失败...", "create_resources": "正在创建 resources 目录...", "resources_error": "请将 BinOutput 和 ExcelBinOutput 复制到 resources 目录。", "version": "Grasscutter 版本:%s-%s" @@ -192,7 +192,7 @@ "server_kick_player": "正在踢出玩家 [%s:%s]...", "description": "从服务器内踢出指定玩家" }, - "kill": { + "killall": { "usage": "用法:killall [玩家UID] [场景ID]", "scene_not_found_in_player_world": "未在玩家世界中找到此场景。", "kill_monsters_in_scene": "已杀死场景 %s 中的 %s 个怪物。", @@ -201,7 +201,7 @@ "killCharacter": { "usage": "用法:killcharacter [玩家ID]", "success": "已杀死 %s 当前角色。", - "description": "杀死当前角色" + "description": "杀死玩家当前角色" }, "language": { "current_language": "当前语言是:%s", @@ -246,6 +246,7 @@ }, "resetShopLimit": { "usage": "用法:resetshop <玩家ID>", + "success": "重置完成。", "description": "重置所选玩家的商店刷新时间" }, "sendMail": { @@ -411,7 +412,7 @@ "index": { "title": "文档", "handbook": "GM Handbook", - "gacha_mapping": "祈愿映射 JSON" + "gacha_mapping": "祈愿物品映射JSON" } } } diff --git a/src/main/resources/languages/zh-TW.json b/src/main/resources/languages/zh-TW.json index 83d4f4550..3b1e0b71a 100644 --- a/src/main/resources/languages/zh-TW.json +++ b/src/main/resources/languages/zh-TW.json @@ -191,7 +191,7 @@ "server_kick_player": "正在踢出玩家 [%s:%s]", "description": "從伺服器內踢出指定玩家。" }, - "kill": { + "killall": { "usage": "用法:killall [playerUid] [sceneId]", "scene_not_found_in_player_world": "未在玩家世界中找到此場景", "kill_monsters_in_scene": "已殺死 %s 個怪物。 [場景ID: %s]", @@ -250,6 +250,7 @@ }, "resetShopLimit": { "usage": "用法:/resetshop ", + "success": "重置完成。", "description": "重置所選玩家的商店刷新時間。" }, "sendMail": {