summaryrefslogtreecommitdiff
path: root/website/src
diff options
context:
space:
mode:
authorSho Sakuma <me@m1sk9.dev>2026-09-28 23:43:13 +0900
committerSho Sakuma <me@m1sk9.dev>2026-09-28 23:43:13 +0900
commita22fce70db7b43aadd8baa42e87a4430a8b1e05f (patch)
tree4cb170c50669db3ca7e046b8447294e8201146cc /website/src
parent479000d491f8b1363a1e6a6e8f6fac85e0fc74bd (diff)
downloadLunaticChat-a22fce70db7b43aadd8baa42e87a4430a8b1e05f.tar.gz
LunaticChat-a22fce70db7b43aadd8baa42e87a4430a8b1e05f.tar.bz2
LunaticChat-a22fce70db7b43aadd8baa42e87a4430a8b1e05f.zip
fix(paper): splice display names as components and share role labels
Serializing the display name into the legacy text let its color run into everything after it, and legacy text cannot hold hex colors or hover and click events, so names styled by other plugins came out wrong. The name is now spliced into the parsed component instead. {role} is resolved only when the format uses it, since the default formats do not and it costs a member scan and a lookup per message. /lc channel status now shows the same localized role names instead of a second, hard-coded [OWNER] / [MOD] vocabulary that only one of the two places translated. Co-Authored-By: Claude <noreply@anthropic.com>
Diffstat (limited to 'website/src')
-rw-r--r--website/src/docs/developers/platform-paper.md2
-rw-r--r--website/src/ja/docs/developers/platform-paper.md2
2 files changed, 2 insertions, 2 deletions
diff --git a/website/src/docs/developers/platform-paper.md b/website/src/docs/developers/platform-paper.md
index 084d23f..6e6b7f4 100644
--- a/website/src/docs/developers/platform-paper.md
+++ b/website/src/docs/developers/platform-paper.md
@@ -158,7 +158,7 @@ Channel state itself is managed by the `chat/channel` package.
- `Language` (enum) — `EN` / `JA`; unknown codes fall back to EN
- `LanguageManager` — loads `resources/languages/` with KAML at startup and flattens the nested YAML into dotted keys (`toggle.on`, etc.). `getMessage(key, placeholders)` resolves with selected-language → EN fallback and substitutes `{placeholder}`, returning the key itself if not found. A missing EN is a fatal error
- `MessageFormatter` (`object`) — produces an Adventure `Component` with a `[LC]` prefix and highlights `{braces}` placeholders detected by regex
-- `ChatPlaceholder` / `ChatFormat.kt` — the placeholder vocabulary of `messageFormat` and its one renderer: entry points per format (`directMessage` / `channelMessage` / `crossServerGlobalChat`) substitute in a single pass and hand the result to `LegacyComponentSerializer`, so handlers never spell a placeholder name
+- `ChatPlaceholder` / `ChatFormat.kt` — the placeholder vocabulary of `messageFormat` and its one renderer: entry points per format (`directMessage` / `channelMessage` / `crossServerGlobalChat`) substitute in a single pass and hand the result to `LegacyComponentSerializer`, then splice in Component values such as `{display_name}` so their styles and events stay scoped to them. Handlers never spell a placeholder name
## converter — Romaji-to-Japanese conversion
diff --git a/website/src/ja/docs/developers/platform-paper.md b/website/src/ja/docs/developers/platform-paper.md
index 930c696..edcd858 100644
--- a/website/src/ja/docs/developers/platform-paper.md
+++ b/website/src/ja/docs/developers/platform-paper.md
@@ -158,7 +158,7 @@ config フラグ
- `Language` (enum) — `EN` / `JA`.未知コードは EN にフォールバック
- `LanguageManager` — 起動時に `resources/languages/` を KAML でロードし,ネストした YAML をドット記法 (`toggle.on` 等) にフラット化する.`getMessage(key, placeholders)` は 選択言語 → EN フォールバック で解決し `{placeholder}` を置換,未発見はキー自身を返す.EN が無ければ致命エラー
- `MessageFormatter` (`object`) — `[LC]` プレフィックス付きの Adventure `Component` を生成し,`{braces}` プレースホルダを正規表現で検出して色分けする
-- `ChatPlaceholder` / `ChatFormat.kt` — `messageFormat` のプレースホルダ語彙と唯一のレンダラ.フォーマットごとの入口 (`directMessage` / `channelMessage` / `crossServerGlobalChat`) が 1 パスで置換し,結果を `LegacyComponentSerializer` に渡す.ハンドラがプレースホルダ名を綴ることはない
+- `ChatPlaceholder` / `ChatFormat.kt` — `messageFormat` のプレースホルダ語彙と唯一のレンダラ.フォーマットごとの入口 (`directMessage` / `channelMessage` / `crossServerGlobalChat`) が 1 パスで置換し,結果を `LegacyComponentSerializer` に渡したうえで,`{display_name}` のような Component 値を差し込む (スタイルやイベントがその値の範囲に閉じるように).ハンドラがプレースホルダ名を綴ることはない
## converter — ローマ字→日本語変換