Trophy follow-up: inspector, toast wrapping, transparency fix and file-based localization #1126
No reviewers
Labels
No labels
bug
documentation
duplicate
enhancement
GPU
GUI
help wanted
question
Shaders
Video
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/KytyPS5--KytyPS5!1126
Loading…
Reference in a new issue
No description provided.
Delete branch "gh-pr/1126/head"
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?
@Pipe530 on GitHub · 2026-10-06 21:52 UTC · original
Pipe530:pipe530-trophy-followup→main· +1728 −56 · 41 files · 4 commits · closed without mergingFollow-up to #1088 (merged). It adds an inspector to the trophy viewer, fixes a few viewer and toast issues, and adds file-based localization for the trophy system.
Changes
Toast
Trophy viewer
Format_Grayscale8, so transparent pixels stay transparent.Localization (trophy system only)
assets/localization/<locale>.json. All 30 console locales are included."key": "text"objects. Placeholders are{0},{1}, and keys starting with_are ignored, so a_commentkey can be used.en-US.json, then built-in English. A missing or invalid file is skipped, and partial translations work.trophy00.ucpmetadata.Contents/Resourceson macOS).src/common/trophyStrings.{h,cpp}(Common::Trophies::Strings,LocaleName).trophies.cppnow uses the shared locale table.For other contributors: localizing other parts
There is one file per language, so every system adds its keys to the same file under its own prefix (the trophy system uses
trophy.).settings.titletoassets/localization/en-US.jsonand the other locales. Unknown keys are ignored by other systems.Strings::Load(<dir>/assets/localization, console_language). Read it withGet("key")orFormat("key", {"arg"}).How to add a new language is described in
docs/trophy-localization.md. Nothing else in the emulator was moved to this system.Validation
ctest -R trophy_systempasses, including new tests for defaults, fallback chain, placeholders, BOM,_keys and invalid files.@coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-07 04:43 UTC
No actionable comments were generated in the recent review. 🎉
ℹ️ Recent review info
⚙️ Run configuration
586b884c-0178-4697-8eb6-46e23fe0962b📥 Commits
Reviewing files that changed from the base of the PR and between
f5525b8b04and1d3cc8687b.📒 Files selected for processing (1)
src/launcher/CMakeLists.txt🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review.
📝 Walkthrough
Walkthrough
The change adds trophy-string localization for 30 console-language locales, with built-in English strings, locale fallback, JSON loading, and placeholder formatting. CMake copies localization resources into emulator and launcher build outputs and installs them for the emulator and Apple app bundle. The emulator displays localized trophy notifications with wrapped names and Arabic text shaping. The launcher localizes trophy overview and game views and replaces trophy tooltips with an inspector dialog. Tests cover string loading, fallback, formatting, and text shaping.
Priority: ⬇️ Low
Change: Feature
Merge Risk: ⚪ Minimal · up to
1d3ccThe launcher can find its installed translations on macOS. The reviewed change is mergeable after normal checks.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring Coverage
Explanation
Docstring coverage is 29.27% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 41 functions across 8 files. (1 skipped: 1 unsupported.)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
❤️ Share
Comment
@coderabbitai helpto get the list of available commands.@coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 22:46 UTC
On
src/graphics/presentation/systemOverlay.cppline 1145 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Break a title token that exceeds the available width.
If a title has no ASCII spaces,
line.empty()accepts the whole token without checkingfits(candidate). This occurs with long words and titles in scripts that do not use spaces. The clip rectangle then cuts off the title instead of wrapping it. Split an oversized token at UTF-8 character boundaries after retaining the existing word-first wrapping behavior.✅ Addressed in commit
d1b234c@coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 22:46 UTC
On
src/graphics/presentation/systemOverlay.cppline 1223 (outdated):🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Shape and order Arabic text before drawing the subtitle.
When the selected locale is
ar-AE,AddTextreceives the Arabic translation without a bidirectional or shaping step. Loading Arabic glyphs alone will not make the sentence render in the correct order or with connected letter forms. Add a shaping and bidi path for this toast, or do not present the Arabic file as a usable toast translation. Dear ImGui does not provide full RTL or text-shaping support. (github.com)🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift
Load a font that covers the localized toast text.
EnsureContextcreates the ImGui context without loading a font. The new subtitle uses that default font for Japanese, Korean, Chinese, Thai, Arabic, and other translations. Dear ImGui’s default font does not provide those scripts, so these subtitles render with missing glyphs. Load suitable font coverage before drawing localized notifications. (github.com)✅ Addressed in commit
d1b234c@coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 23:02 UTC
On
src/launcher/CMakeLists.txtline 83 (outdated):🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Copy changed translations without requiring a launcher relink.
If a translator edits a source JSON file and builds the already up-to-date launcher, this
POST_BUILDcommand does not run. The launcher continues to read its stale copied file. Use an always-run resource target like the emulator’s copy target, or make the copy depend on the JSON inputs. (cmake.org)✅ Addressed in commit
1d3cc86@coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · reviewed
Actionable comments posted: 4
ℹ️ Review info
⚙️ Run configuration
345c166c-87c6-4532-b323-34f1c8dad91a📥 Commits
Reviewing files that changed from the base of the PR and between
7492cb9577andde17763260.📒 Files selected for processing (39)
CMakeLists.txtassets/localization/ar-AE.jsonassets/localization/cs-CZ.jsonassets/localization/da-DK.jsonassets/localization/de-DE.jsonassets/localization/el-GR.jsonassets/localization/en-GB.jsonassets/localization/en-US.jsonassets/localization/es-419.jsonassets/localization/es-ES.jsonassets/localization/fi-FI.jsonassets/localization/fr-CA.jsonassets/localization/fr-FR.jsonassets/localization/hu-HU.jsonassets/localization/id-ID.jsonassets/localization/it-IT.jsonassets/localization/ja-JP.jsonassets/localization/ko-KR.jsonassets/localization/nl-NL.jsonassets/localization/no-NO.jsonassets/localization/pl-PL.jsonassets/localization/pt-BR.jsonassets/localization/pt-PT.jsonassets/localization/ro-RO.jsonassets/localization/ru-RU.jsonassets/localization/sv-SE.jsonassets/localization/th-TH.jsonassets/localization/tr-TR.jsonassets/localization/vi-VN.jsonassets/localization/zh-Hans.jsonassets/localization/zh-Hant.jsondocs/trophy-localization.mdsrc/common/trophies.cppsrc/common/trophyStrings.cppsrc/common/trophyStrings.hsrc/graphics/presentation/systemOverlay.cppsrc/launcher/CMakeLists.txtsrc/launcher/src/trophyViewerDialog.cpptests/TrophySystemTests.cppIncluded review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.
@ -0,0 +113,4 @@i += length;}return result;}@coderabbitai[bot] on GitHub · 2026-10-06 22:49 UTC · original · edited 2026-10-06 22:59 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Bound truncated UTF-8 sequences in
Decode.Decodedoes not check that a lead byte has all of its continuation bytes. It also does not check that each continuation byte is valid. A trailing lead byte, such as a name that ends with0xD8, produces a partial code point.i += lengththen moves pasttext.size(), which ends the loop safely. However, the bad code point is still appended.Appendcan then encode a value that the input never contained. A stray byte in the range0x80–0xBFis decoded as a 4-byte lead, which removes the three bytes after it.Trophy names come from game metadata, so malformed input can occur. The function runs only when the text contains Arabic, so the impact is limited to garbled Arabic toast text. When a sequence is invalid, emit U+FFFD and advance one byte.
✅ Addressed in commit
f5525b8@ -0,0 +228,4 @@Append(out, ltr ? cps[k] : Mirror(cps[k]));}end = begin;}@coderabbitai[bot] on GitHub · 2026-10-06 22:49 UTC · original · edited 2026-10-06 22:59 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Mirror paired punctuation and keep neutrals inside LTR runs.
The reversal loop reverses every non-LTR code point. Brackets are not mirrored, so
(and)are displayed in the wrong direction. Spaces and punctuation between two Latin words also break the LTR run. For example,"ب ab cd"renders as"cd ab ب", which reverses the order of the Latin words. Include spaces between LTR characters in the LTR run, and mirror()[]{}<>in the reversed segments.✅ Addressed in commit
f5525b8@ -1105,0 +1227,4 @@i += 2;} else {word += name[i];}@coderabbitai[bot] on GitHub · 2026-10-06 22:49 UTC · original · edited 2026-10-06 22:59 UTC
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 3752
🏁 Script executed:
Repository: KytyPS5/KytyPS5
Length of output: 11330
Wrap long Thai titles by code point.
Thai UTF-8 lead bytes (
0xE0) bypass the character-break branch, so a space-free title is collected as one token. When the first token is flushed,line.empty()accepts it without checkingfits. A sufficiently long title can exceed the wrap width and be clipped at the draw list’s right clip edge. Include Thai lead bytes in the character-break branch.🐛 Suggested fix
📝 Committable suggestion
✅ Addressed in commit
f5525b8@coderabbitai[bot] on GitHub · 2026-10-06 22:49 UTC · original · reviewed
Actionable comments posted: 3
ℹ️ Review info
⚙️ Run configuration
db853354-77bb-49aa-a372-eb9c175a3343📥 Commits
Reviewing files that changed from the base of the PR and between
de17763260andd1b234c192.📒 Files selected for processing (5)
docs/trophy-localization.mdsrc/common/textShaping.cppsrc/common/textShaping.hsrc/graphics/presentation/systemOverlay.cpptests/TrophySystemTests.cpp🚧 Files skipped from review as they are similar to previous changes (2)
Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.
@Nmzik on GitHub · 2026-10-08 14:54 UTC · original
all fixes have been merged except localization support.
@gandalfthewhite19890404 on GitHub · 2026-10-14 02:36 UTC · original
Why localization was not merged? Anyone can continue it? Or you're against other languages
@Nmzik on GitHub · 2026-10-16 13:24 UTC · original
@gandalfthewhite19890404 @Pipe530 Closed by mistake. I'll try to find a way to pack localizations files
@Nmzik on GitHub · 2026-10-16 14:20 UTC · original
Merged localization. JSONs are embedded
Pull request closed