mirror of
https://github.com/Pasta-Devs/Marinara-Engine.git
synced 2026-12-03 19:00:50 +07:00
[PR #2541] [MERGED] fix(game): match non-Latin speaker names for avatars and sprites #5644
Labels
No labels
android
bug
bugfix
ci
client
code freeze pause
container
dependencies
docs
documentation
duplicate
enhancement
feature
feature
feature
feature-creep
fixed-in-refactor
fixed-in-staging
good first issue
help wanted
in-pr
in-pr
needs-codeowner-decision
normal-scope
old-codebase
old-codebase
pull-request
qol
question
refactor
regression
revisit later
roadmap
scope-risk
scope-risk
server
server
shared
soup
upstream
windows
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Pasta-Devs/Marinara-Engine#5644
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/Pasta-Devs/Marinara-Engine/pull/2541
Author: @Lemon-will
Created: 6/9/2026
Status: ✅ Merged
Merged: 6/9/2026
Merged by: @SpicyMarinara
Base:
staging← Head:fix/game-character-name-match-cjk📝 Commits (1)
81398abfix(game): match non-Latin speaker names for avatars and sprites📊 Changes
1 file changed (+5 additions, -1 deletions)
View changed files
📝
packages/client/src/lib/game-character-name-match.ts(+5 -1)📄 Description
Linked issue
Closes #2534
Why this change
In Game Mode, characters whose names are written in non-Latin scripts (Japanese
hiragana/katakana/kanji, Cyrillic, etc.) never showed their message-window avatar
or full-body character sprite — the avatar fell back to the default silhouette.
The same character's round icon rendered correctly, which pointed at speaker-name
matching rather than asset loading.
Root cause:
normalizeCharacterName(
packages/client/src/lib/game-character-name-match.ts) normalized with[^a-z0-9], stripping every non-Latin character. Non-Latin names collapsed to anempty string, so
findNamedEntrybailed out early andfindNamedMapValue(speakerAvatarInfos, speaker)never matched. That singlefailure caused both symptoms: the silhouette avatar fallback, and an unset
activeSpeakerthat blocked full-body sprite resolution.What changed
normalizeCharacterName: replaced ASCII-only[^a-z0-9]+with[^\p{L}\p{N}\p{M}]+and theuflag, keeping letters/numbers/combining marksfrom any script (the combining-mark class preserves e.g. the katakana
voiced-sound mark). ASCII/Latin names normalize exactly as before — a one-line
behavioral change.
Out of scope (follow-up): fuzzy/partial matching is still tuned for Latin —
getCharacterNameTokensdrops tokens of length ≤ 2 andincludesWholeVariantrequires length ≥ 3, so short CJK names (e.g. a 2-char name with a decorated
speaker label like
ナミ(怒)) may still miss exact match. Left for a separatePR to keep this focused.
Validation
pnpm checkpasses locallyCONTRIBUTING.mdManual verification notes
Tested on a local production build:
pnpm check(impeccable check + lint + typecheck + production build) — passed.カエデ): message-window avatar now shows the character image instead ofnpc-silhouette.かえで): same result.full_*sprite exists.kaede): avatar + sprite still resolve as before (no regression).Docs and release impact
UI evidence (if applicable)
N/A
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.