From a22fce70db7b43aadd8baa42e87a4430a8b1e05f Mon Sep 17 00:00:00 2001 From: Sho Sakuma Date: Mon, 28 Sep 2026 23:43:13 +0900 Subject: 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 --- website/src/docs/developers/platform-paper.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'website/src/docs/developers') 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 -- cgit v1.2.1