diff options
| author | Sho Sakuma <me@m1sk9.dev> | 2026-01-25 16:26:14 +0900 |
|---|---|---|
| committer | Sho Sakuma <me@m1sk9.dev> | 2026-01-25 16:26:14 +0900 |
| commit | d35eff7d10d6bebd5231e7a5d59a8a13f241e1ee (patch) | |
| tree | 8f8f37fd8bb158039474371dbca5aa0328888a26 | |
| parent | 9f4fb8f4abec562cf13cb1dd225828876875c790 (diff) | |
| download | LunaticChat-d35eff7d10d6bebd5231e7a5d59a8a13f241e1ee.tar.gz LunaticChat-d35eff7d10d6bebd5231e7a5d59a8a13f241e1ee.tar.bz2 LunaticChat-d35eff7d10d6bebd5231e7a5d59a8a13f241e1ee.zip | |
refactor: Organize keys by function
10 files changed, 56 insertions, 38 deletions
diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/core/LunaticCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/core/LunaticCommand.kt index 817c002..1fe4835 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/core/LunaticCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/core/LunaticCommand.kt @@ -98,7 +98,7 @@ abstract class LunaticCommand( if (isPlayerOnly && !ctx.isPlayer) { return CommandResult.Failure( MessageFormatter.formatError( - plugin.languageManager.getMessage("playerOnlyCommand"), + plugin.languageManager.getMessage("general.playerOnlyCommand"), ), ) } diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/ReplyCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/ReplyCommand.kt index af7a32c..185581a 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/ReplyCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/ReplyCommand.kt @@ -58,7 +58,7 @@ class ReplyCommand( dmHandler.getReplyTarget(sender) ?: return CommandResult.Failure( MessageFormatter.formatError( - languageManager.getMessage("replyTargetNotFound"), + languageManager.getMessage("directMessage.replyTargetNotFound"), ), ) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/TellCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/TellCommand.kt index 1238138..c84de33 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/TellCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/TellCommand.kt @@ -69,14 +69,14 @@ class TellCommand( Bukkit.getPlayer(targetName) ?: return CommandResult.Failure( MessageFormatter.formatError( - languageManager.getMessage("tellTargetOffline", mapOf("target" to targetName)), + languageManager.getMessage("directMessage.targetOffline", mapOf("target" to targetName)), ), ) if (recipient.uniqueId == sender.uniqueId) { return CommandResult.Failure( MessageFormatter.formatError( - languageManager.getMessage("tellYourself"), + languageManager.getMessage("directMessage.yourself"), ), ) } diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/SettingsCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/SettingsCommand.kt index 51ddac8..9cd6645 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/SettingsCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/SettingsCommand.kt @@ -105,7 +105,7 @@ class SettingsCommand( val availableKeys = settingHandlerRegistry.getAvailableKeys() val helpMessage = MessageFormatter.format( - languageManager.getMessage("settingsAvailableValues", mapOf("values" to availableKeys.joinToString(", "))), + languageManager.getMessage("settings.availableValues", mapOf("values" to availableKeys.joinToString(", "))), ) ctx.reply(helpMessage) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt index b91c8ca..20971ee 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/impl/lc/StatusCommand.kt @@ -48,8 +48,8 @@ class StatusCommand( sendMessage( MessageFormatter .format( - languageManager.getMessage("statusRunningVersion", mapOf("version" to meta.version)), - ).hoverEvent(HoverEvent.showText(Component.text(languageManager.getMessage("statusHover")))), + languageManager.getMessage("status.runningVersion", mapOf("version" to meta.version)), + ).hoverEvent(HoverEvent.showText(Component.text(languageManager.getMessage("status.hover")))), ) urls.forEach { (label, url) -> diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/DirectMessageNoticeSettingHandler.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/DirectMessageNoticeSettingHandler.kt index 90ff0ad..1564615 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/DirectMessageNoticeSettingHandler.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/DirectMessageNoticeSettingHandler.kt @@ -30,7 +30,7 @@ class DirectMessageNoticeSettingHandler( val toggleText = languageManager.getToggleText(enable) val message = MessageFormatter.formatSuccess( - languageManager.getMessage("directMessageNoticeToggle", mapOf("toggle" to toggleText)), + languageManager.getMessage("directMessage.noticeToggle", mapOf("toggle" to toggleText)), ) player.sendMessage(message) @@ -44,7 +44,7 @@ class DirectMessageNoticeSettingHandler( val toggleText = languageManager.getToggleText(settings.directMessageNotificationEnabled) val message = MessageFormatter.format( - languageManager.getMessage("directMessageNoticeStatus", mapOf("toggle" to toggleText)), + languageManager.getMessage("directMessage.noticeStatus", mapOf("toggle" to toggleText)), ) player.sendMessage(message) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/JapaneseConversionSettingHandler.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/JapaneseConversionSettingHandler.kt index 39cbc0d..2c682ba 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/JapaneseConversionSettingHandler.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/command/setting/handler/JapaneseConversionSettingHandler.kt @@ -30,7 +30,7 @@ class JapaneseConversionSettingHandler( val toggleText = languageManager.getToggleText(enable) val message = MessageFormatter.formatSuccess( - languageManager.getMessage("romajiConversionToggle", mapOf("toggle" to toggleText)), + languageManager.getMessage("romajiConversion.toggle", mapOf("toggle" to toggleText)), ) player.sendMessage(message) @@ -44,7 +44,7 @@ class JapaneseConversionSettingHandler( val toggleText = languageManager.getToggleText(settings.japaneseConversionEnabled) val message = MessageFormatter.format( - languageManager.getMessage("romajiConversionStatus", mapOf("toggle" to toggleText)), + languageManager.getMessage("romajiConversion.status", mapOf("toggle" to toggleText)), ) player.sendMessage(message) diff --git a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt index 1b53453..ca73567 100644 --- a/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt +++ b/platform-paper/src/main/kotlin/dev/m1sk9/lunaticChat/paper/listener/PlayerPresenceListener.kt @@ -25,7 +25,7 @@ class PlayerPresenceListener( player.sendMessage { Component .text( - languageManager.getMessage("newUpdateAvailable"), + languageManager.getMessage("general.newUpdateAvailable"), ).clickEvent( ClickEvent.openUrl("https://github.com/m1sk9/LunaticChat/releases/latest"), ) diff --git a/platform-paper/src/main/resources/languages/en.yml b/platform-paper/src/main/resources/languages/en.yml index d61d03f..fde5f52 100644 --- a/platform-paper/src/main/resources/languages/en.yml +++ b/platform-paper/src/main/resources/languages/en.yml @@ -18,19 +18,28 @@ commandDescription: tell: "Send a direct message to another player" lc: "LunaticChat Main Command" -directMessageNoticeStatus: "Direct message notifications are currently {toggle}" -directMessageNoticeToggle: "Direct message notifications have been set to {toggle}" -playerOnlyCommand: "This command can only be executed by players." -replyTargetNotFound: "Reply target player not found." -romajiConversionToggle: "Romaji-to-kana conversion has been set to {toggle}" -romajiConversionStatus: "Romaji-to-kana conversion is currently {toggle}" -settingsAvailableValues: "Available settings value: {values}" -statusHover: "LunaticChat was born as the successor to LunaChat. With respect to its original creator, uccchyocean." -statusRunningVersion: "Running LunaticChat v{version}" -tellTargetOffline: "Player '{target}' is currently offline." -tellYourself: "You cannot send a message to yourself." -newUpdateAvailable: "The new version of LunaticChat is now available! You can download it from GitHub or Modrinth." -noPermission: "You do not have permission to execute this command." +directMessage: + noticeStatus: "Direct message notifications are currently {toggle}" + noticeToggle: "Direct message notifications have been set to {toggle}" + targetOffline: "Player '{target}' is currently offline." + yourself: "You cannot send a message to yourself." + replyTargetNotFound: "Reply target player not found." + +romajiConversion: + toggle: "Romaji-to-kana conversion has been set to {toggle}" + status: "Romaji-to-kana conversion is currently {toggle}" + +status: + hover: "LunaticChat was born as the successor to LunaChat. With respect to its original creator, uccchyocean." + runningVersion: "Running LunaticChat v{version}" + +settings: + availableValues: "Available settings value: {values}" + +general: + playerOnlyCommand: "This command can only be executed by players." + newUpdateAvailable: "The new version of LunaticChat is now available! You can download it from GitHub or Modrinth." + noPermission: "You do not have permission to execute this command." toggle: off: "Disabled" diff --git a/platform-paper/src/main/resources/languages/ja.yml b/platform-paper/src/main/resources/languages/ja.yml index 5241cc8..fbde9a7 100644 --- a/platform-paper/src/main/resources/languages/ja.yml +++ b/platform-paper/src/main/resources/languages/ja.yml @@ -18,19 +18,28 @@ commandDescription: notice: "ダイレクトメッセージ通知のオン/オフを切り替えます" lc: "LunaticChat のメインコマンド" -directMessageNoticeToggle: "ダイレクトメッセージ通知を{toggle}にしました" -directMessageNoticeStatus: "現在ダイレクトメッセージ通知は{toggle}です" -playerOnlyCommand: "このコマンドはプレイヤーのみが実行できます" -replyTargetNotFound: "返信対象のプレイヤーが見つかりません" -romajiConversionToggle: "かな・ローマ字変換機能を{toggle}にしました" -romajiConversionStatus: "現在かな・ローマ字変換機能は{toggle}です" -settingsAvailableValues: "使用可能な設定値: {values}" -statusHover: "LunaticChat は LunaChatの後継として生まれました。\nオリジナルの作者であるucchyoceanに敬意を込めて。" -statusRunningVersion: "LunaticChat v{version} が使用されています" -tellTargetOffline: "プレイヤー '{target}' は現在オフラインです" -tellYourself: "自分自身にメッセージを送信することはできません" -newUpdateAvailable: "LunaticChat の新しいバージョンが利用可能です。GitHubまたはModrinthからダウンロードできます" -noPermission: "このコマンドを実行する権限がありません" +directMessage: + noticeToggle: "ダイレクトメッセージ通知を{toggle}にしました" + noticeStatus: "現在ダイレクトメッセージ通知は{toggle}です" + targetOffline: "プレイヤー '{target}' は現在オフラインです" + yourself: "自分自身にメッセージを送信することはできません" + replyTargetNotFound: "返信対象のプレイヤーが見つかりません" + +romajiConversion: + toggle: "かな・ローマ字変換機能を{toggle}にしました" + status: "現在かな・ローマ字変換機能は{toggle}です" + +status: + hover: "LunaticChat は LunaChatの後継として生まれました。\nオリジナルの作者であるucchyoceanに敬意を込めて。" + runningVersion: "LunaticChat v{version} が使用されています" + +settings: + availableValues: "使用可能な設定値: {values}" + +general: + playerOnlyCommand: "このコマンドはプレイヤーのみが実行できます" + newUpdateAvailable: "LunaticChat の新しいバージョンが利用可能です。GitHubまたはModrinthからダウンロードできます" + noPermission: "このコマンドを実行する権限がありません" toggle: on: "有効" |
