Trophy follow-up: inspector, toast wrapping, transparency fix and file-based localization #1126

Closed
github-bot wants to merge 4 commits from gh-pr/1126/head into gh-pr/1126/base
Owner

@⁠Pipe530 on GitHub · 2026-10-06 21:52 UTC · original
Pipe530:pipe530-trophy-followup → main · +1728 −56 · 41 files · 4 commits · closed without merging

Follow-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

  • Long trophy titles wrap at word boundaries (never mid-word). The box grows vertically and "Trophy earned!" moves below the last line, so nothing is cut off screen.
  • The "Trophy earned!" subtitle now comes from the language files.

Trophy viewer

  • Locked trophy icons are grayscaled in an alpha-capable format (ARGB32) instead of Format_Grayscale8, so transparent pixels stay transparent.
  • Clicking a trophy opens an inspector with a large icon, name, grade, status, earned date and time, and details.
  • Hidden locked trophies still show "Hidden trophy" in the list. The inspector has a "Show hidden information" button that reveals the real data.
  • The native hover tooltip is removed. There is no rarity, because the emulator has no PSN access.

Localization (trophy system only)

  • Interface text is read from editable files: one UTF-8 JSON per console locale, assets/localization/<locale>.json. All 30 console locales are included.
  • The files are flat "key": "text" objects. Placeholders are {0}, {1}, and keys starting with _ are ignored, so a _comment key can be used.
  • Fallback: selected locale, then en-US.json, then built-in English. A missing or invalid file is skipped, and partial translations work.
  • Trophy names and descriptions are unchanged. They still come from the game's trophy00.ucp metadata.
  • The emulator uses the console language from its config. The launcher uses each game's language setting.
  • Files are copied next to the emulator and launcher on build and installed by CMake (inside Contents/Resources on macOS).
  • New module src/common/trophyStrings.{h,cpp} (Common::Trophies::Strings, LocaleName). trophies.cpp now uses the shared locale table.
  • The translations were written by the PR author. Native speakers are welcome to review them.

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.).

  1. Add keys such as settings.title to assets/localization/en-US.json and the other locales. Unknown keys are ignored by other systems.
  2. Load the table once, with Strings::Load(<dir>/assets/localization, console_language). Read it with Get("key") or Format("key", {"arg"}).
  3. Give the code built-in English defaults, so a missing file still works.

How to add a new language is described in docs/trophy-localization.md. Nothing else in the emulator was moved to this system.

Validation

  • Full Windows build (MSVC/Ninja) succeeds.
  • ctest -R trophy_system passes, including new tests for defaults, fallback chain, placeholders, BOM, _ keys and invalid files.
  • All 30 JSON files were checked for identical key sets and no corrupted characters.
  • Visually verified: toast wrapping and non-Latin or right-to-left rendering of the translated text.
**@⁠Pipe530** on GitHub · 2026-10-06 21:52 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126) `Pipe530:pipe530-trophy-followup` → `main` · +1728 −56 · 41 files · 4 commits · closed without merging Follow-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 - Long trophy titles wrap at word boundaries (never mid-word). The box grows vertically and "Trophy earned!" moves below the last line, so nothing is cut off screen. - The "Trophy earned!" subtitle now comes from the language files. ### Trophy viewer - Locked trophy icons are grayscaled in an alpha-capable format (ARGB32) instead of `Format_Grayscale8`, so transparent pixels stay transparent. - Clicking a trophy opens an inspector with a large icon, name, grade, status, earned date and time, and details. - Hidden locked trophies still show "Hidden trophy" in the list. The inspector has a "Show hidden information" button that reveals the real data. - The native hover tooltip is removed. There is no rarity, because the emulator has no PSN access. ### Localization (trophy system only) - Interface text is read from editable files: one UTF-8 JSON per console locale, `assets/localization/<locale>.json`. All 30 console locales are included. - The files are flat `"key": "text"` objects. Placeholders are `{0}`, `{1}`, and keys starting with `_` are ignored, so a `_comment` key can be used. - Fallback: selected locale, then `en-US.json`, then built-in English. A missing or invalid file is skipped, and partial translations work. - Trophy names and descriptions are unchanged. They still come from the game's `trophy00.ucp` metadata. - The emulator uses the console language from its config. The launcher uses each game's language setting. - Files are copied next to the emulator and launcher on build and installed by CMake (inside `Contents/Resources` on macOS). - New module `src/common/trophyStrings.{h,cpp}` (`Common::Trophies::Strings`, `LocaleName`). `trophies.cpp` now uses the shared locale table. - The translations were written by the PR author. Native speakers are welcome to review them. ## 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.`). 1. Add keys such as `settings.title` to `assets/localization/en-US.json` and the other locales. Unknown keys are ignored by other systems. 2. Load the table once, with `Strings::Load(<dir>/assets/localization, console_language)`. Read it with `Get("key")` or `Format("key", {"arg"})`. 3. Give the code built-in English defaults, so a missing file still works. How to add a new language is described in `docs/trophy-localization.md`. Nothing else in the emulator was moved to this system. ## Validation - Full Windows build (MSVC/Ninja) succeeds. - `ctest -R trophy_system` passes, including new tests for defaults, fallback chain, placeholders, BOM, `_` keys and invalid files. - All 30 JSON files were checked for identical key sets and no corrupted characters. - Visually verified: toast wrapping and non-Latin or right-to-left rendering of the translated text.
Co-authored-by: Copilot App <[email protected]>
Merge system fallback fonts into the overlay font per console language, join and reorder Arabic text, and allow line breaks between CJK characters.

Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 09:44:13 +00:00
github-bot closed this pull request 2026-11-26 09:44:13 +00:00
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-07 04:43 UTC

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 586b884c-0178-4697-8eb6-46e23fe0962b
📥 Commits

Reviewing files that changed from the base of the PR and between f5525b8b04 and 1d3cc8687b.

📒 Files selected for processing (1)
  • src/launcher/CMakeLists.txt
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/launcher/CMakeLists.txt

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 1d3cc

The 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)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning 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: … Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly identifies the trophy inspector, toast wrapping, transparency fix, and file-based localization changes.
Description check ✅ Passed The description explains the trophy viewer and toast changes, localization behavior, file handling, and validation relevant to the changeset.
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.)

  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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 help to get the list of available commands.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 21:58 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#issuecomment-6026211407) · edited 2026-10-07 04:43 UTC <!-- This is an auto-generated comment: summarize by coderabbit.ai --> <!-- review_stack_entry_start --> <a href="https://app.coderabbit.ai/change-stack/KytyPS5/KytyPS5/pull/1126?scope=ghh_OusAJGA4HG8ljoOV0wJvVx8NmnZIjc2DdjmxOu0xZWA&amp;cs_source=review_comment"><img src="https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui-dark.svg?v=2" alt="Review in Change Stack →" width="220" height="32"></a> <!-- review_stack_entry_end --> <!-- recent_review_start --> No actionable comments were generated in the recent review. 🎉 <details> <summary>ℹ️ Recent review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `586b884c-0178-4697-8eb6-46e23fe0962b` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between f5525b8b04a5d2ccbe850877ce0ce3644870ed07 and 1d3cc8687b01a4e9a9cccd0a1b91907dc53e886f. </details> <details> <summary>📒 Files selected for processing (1)</summary> * `src/launcher/CMakeLists.txt` </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary> * src/launcher/CMakeLists.txt </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 5 remain after this review. </details> --- <!-- recent_review_end --> <!-- walkthrough_start --> <details> <summary>📝 Walkthrough</summary> ## 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. </details> <!-- walkthrough_end --> <!-- change_assessment_start --> **Priority:** ⬇️ Low <!-- change_assessment_commit:"1d3cc8687b01a4e9a9cccd0a1b91907dc53e886f" --> **Change:** Feature <!-- change_assessment_end --> <!-- final_review_risk_start --> **Merge Risk:** _⚪ Minimal_ · up to `1d3cc` <!-- final_review_risk_coverage:{"sourceCommitId":"1d3cc8687b01a4e9a9cccd0a1b91907dc53e886f","coveredCommitId":"1d3cc8687b01a4e9a9cccd0a1b91907dc53e886f","kind":"reviewed"} --> The launcher can find its installed translations on macOS. The reviewed change is mergeable after normal checks. <!-- final_review_risk_end --> <!-- pre_merge_checks_walkthrough_start --> <details> <summary>🚥 Pre-merge checks | ✅ 4 | ❌ 1</summary> ### ❌ Failed checks (1 warning) | Check name | Status | Explanation | Resolution | | :----------------: | :--------- | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------- | | Docstring Coverage | ⚠️ Warning | 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: … | Write docstrings for the functions missing them to satisfy the coverage threshold. | <details> <summary>✅ Passed checks (4 passed)</summary> | Check name | Status | Explanation | | :------------------------: | :------- | :-------------------------------------------------------------------------------------------------------------------------------------------- | | Linked Issues check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Out of Scope Changes check | ✅ Passed | Check skipped because no linked issues were found for this pull request. | | Title check | ✅ Passed | The title clearly identifies the trophy inspector, toast wrapping, transparency fix, and file-based localization changes. | | Description check | ✅ Passed | The description explains the trophy viewer and toast changes, localization behavior, file handling, and validation relevant to the changeset. | </details> <details> <summary>Full details: Docstring Coverage</summary> **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.) </details> </details> <!-- pre_merge_checks_walkthrough_end --> <!-- autopilot:start --> - [ ] <!-- {"checkboxId":"2708ad07-9f24-4260-9c11-7dc76a49f2e3"} --> <strong title="Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts">Autopilot</strong> · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts <!-- autopilot:end --> <!-- tips_start --> --- Thanks for using [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=KytyPS5/KytyPS5&utm_content=1126)! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. <details> <summary>❤️ Share</summary> - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code) </details> <sub>Comment `@coderabbitai help` to get the list of available commands.</sub> <!-- tips_end -->
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 22:46 UTC
On src/graphics/presentation/systemOverlay.cpp line 1145 (outdated):

@@ -1101,7 +1111,55 @@ struct SystemOverlay::Impl {
 		               0.65f, 1.25f);
 		const float width = std::max(
 		    0.0f, std::min(520.0f * screen_scale, static_cast<float>(frame_extent.width) - 32.0f));
-		const float  height   = 104.0f * screen_scale;
+		const float  pad       = 10.0f * screen_scale;
+		const float  base_h    = 104.0f * screen_scale;
+		const float  icon_size = base_h - 2.0f * pad;
+		const int    grade     = trophy_notification->grade;
+		const float  title_fs  = 26.0f * screen_scale;
+		const float  line_h    = 30.0f * screen_scale;
+		const float  sub_fs    = 20.0f * screen_scale;
+		const float  text_pad  = 16.0f * screen_scale;
+		const float  title_off = (grade > 0 && grade <= 4) ? 30.0f * screen_scale : 0.0f;
+		const float  text_x0   = (trophy_notification_image != nullptr)
+		                             ? 2.0f * pad + icon_size - pad + 18.0f * screen_scale
+		                             : 20.0f * screen_scale;
+		const float  wrap_w    = std::max(40.0f, width - text_x0 - title_off - text_pad);
+		// Greedy word wrap: lines only break at spaces so words are never split.
+		std::vector<std::string> title_lines;
+		{
+			auto*       font = ImGui::GetFont();
+			std::string line;
+			std::string word;
+			const auto  fits = [&](const std::string& s) {
+                return font->CalcTextSizeA(title_fs, FLT_MAX, 0.0f, s.c_str()).x <= wrap_w;
+			};
+			const auto flush_word = [&] {
+				if (word.empty()) {
+					return;
+				}
+				const auto candidate = line.empty() ? word : line + " " + word;
+				if (line.empty() || fits(candidate)) {
+					line = candidate;
+				} else {
+					title_lines.push_back(line);
+					line = word;

🎯 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 checking fits(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](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4200837907) · edited 2026-10-06 22:46 UTC On `src/graphics/presentation/systemOverlay.cpp` line 1145 (outdated): ```diff @@ -1101,7 +1111,55 @@ struct SystemOverlay::Impl { 0.65f, 1.25f); const float width = std::max( 0.0f, std::min(520.0f * screen_scale, static_cast<float>(frame_extent.width) - 32.0f)); - const float height = 104.0f * screen_scale; + const float pad = 10.0f * screen_scale; + const float base_h = 104.0f * screen_scale; + const float icon_size = base_h - 2.0f * pad; + const int grade = trophy_notification->grade; + const float title_fs = 26.0f * screen_scale; + const float line_h = 30.0f * screen_scale; + const float sub_fs = 20.0f * screen_scale; + const float text_pad = 16.0f * screen_scale; + const float title_off = (grade > 0 && grade <= 4) ? 30.0f * screen_scale : 0.0f; + const float text_x0 = (trophy_notification_image != nullptr) + ? 2.0f * pad + icon_size - pad + 18.0f * screen_scale + : 20.0f * screen_scale; + const float wrap_w = std::max(40.0f, width - text_x0 - title_off - text_pad); + // Greedy word wrap: lines only break at spaces so words are never split. + std::vector<std::string> title_lines; + { + auto* font = ImGui::GetFont(); + std::string line; + std::string word; + const auto fits = [&](const std::string& s) { + return font->CalcTextSizeA(title_fs, FLT_MAX, 0.0f, s.c_str()).x <= wrap_w; + }; + const auto flush_word = [&] { + if (word.empty()) { + return; + } + const auto candidate = line.empty() ? word : line + " " + word; + if (line.empty() || fits(candidate)) { + line = candidate; + } else { + title_lines.push_back(line); + line = word; ``` **🎯 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 checking `fits(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. <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:5c8e38fc219fd1e4afe163fc --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit d1b234c
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 22:46 UTC
On src/graphics/presentation/systemOverlay.cpp line 1223 (outdated):

@@ -1158,10 +1213,14 @@ struct SystemOverlay::Impl {
 			title_x += 30.0f * u;
 		}
 		draw->PushClipRect(top_left, {bottom_right.x - 16.0f * screen_scale, bottom_right.y}, true);
-		draw->AddText(nullptr, 26.0f * screen_scale, {title_x, title_y},
-		              fade(255, 255, 255, 255), trophy_notification->name.c_str());
-		draw->AddText(nullptr, 20.0f * screen_scale, {text_left, title_y + 38.0f * screen_scale},
-		              fade(176, 180, 192, 255), "Trophy earned!");
+		float line_y = title_y;
+		for (const auto& line : title_lines) {
+			draw->AddText(nullptr, title_fs, {title_x, line_y}, fade(255, 255, 255, 255),
+			              line.c_str());
+			line_y += line_h;
+		}
+		draw->AddText(nullptr, sub_fs, {text_left, line_y + 8.0f * screen_scale},
+		              fade(176, 180, 192, 255), trophy_notification->subtitle.c_str());

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Shape and order Arabic text before drawing the subtitle.

When the selected locale is ar-AE, AddText receives 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.

EnsureContext creates 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](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4200837914) · edited 2026-10-06 22:46 UTC On `src/graphics/presentation/systemOverlay.cpp` line 1223 (outdated): ```diff @@ -1158,10 +1213,14 @@ struct SystemOverlay::Impl { title_x += 30.0f * u; } draw->PushClipRect(top_left, {bottom_right.x - 16.0f * screen_scale, bottom_right.y}, true); - draw->AddText(nullptr, 26.0f * screen_scale, {title_x, title_y}, - fade(255, 255, 255, 255), trophy_notification->name.c_str()); - draw->AddText(nullptr, 20.0f * screen_scale, {text_left, title_y + 38.0f * screen_scale}, - fade(176, 180, 192, 255), "Trophy earned!"); + float line_y = title_y; + for (const auto& line : title_lines) { + draw->AddText(nullptr, title_fs, {title_x, line_y}, fade(255, 255, 255, 255), + line.c_str()); + line_y += line_h; + } + draw->AddText(nullptr, sub_fs, {text_left, line_y + 8.0f * screen_scale}, + fade(176, 180, 192, 255), trophy_notification->subtitle.c_str()); ``` **🎯 Functional Correctness** | **🟠 Major** | **🏗️ Heavy lift** **Shape and order Arabic text before drawing the subtitle.** When the selected locale is `ar-AE`, `AddText` receives 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](https://github.com/ocornut/imgui/issues/7892?utm_source=openai)) <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:e6f2d7a240470ee9cab32f29 --> --- **🎯 Functional Correctness** | **🟠 Major** | **🏗️ Heavy lift** **Load a font that covers the localized toast text.** `EnsureContext` creates 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](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md?utm_source=openai)) <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:7f854f00e7e738849a51eb23 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit d1b234c
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · edited 2026-10-06 23:02 UTC
On src/launcher/CMakeLists.txt line 83 (outdated):

@@ -76,6 +76,12 @@ endif()
 
 set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name})
 
+# Trophy language files are read from next to the launcher.
+add_custom_command(TARGET launcher POST_BUILD
+	COMMAND ${CMAKE_COMMAND} -E copy_directory "${KYTY_LOCALIZATION_DIR}"
+		"$<TARGET_FILE_DIR:launcher>/assets/localization"
+	VERBATIM)

🎯 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_BUILD command 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](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4200837924) · edited 2026-10-06 23:02 UTC On `src/launcher/CMakeLists.txt` line 83 (outdated): ```diff @@ -76,6 +76,12 @@ endif() set_target_properties(launcher PROPERTIES OUTPUT_NAME ${launcher_name}) +# Trophy language files are read from next to the launcher. +add_custom_command(TARGET launcher POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy_directory "${KYTY_LOCALIZATION_DIR}" + "$<TARGET_FILE_DIR:launcher>/assets/localization" + VERBATIM) ``` **🎯 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_BUILD` command 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](https://cmake.org/cmake/help/v3.15/command/add_custom_command.html?utm_source=openai)) <!-- fingerprinting:phantom:poseidon:wombat --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:eee194b9a53000fb4dc9779e --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit 1d3cc86
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 21:58 UTC · original · reviewed

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 345c166c-87c6-4532-b323-34f1c8dad91a
📥 Commits

Reviewing files that changed from the base of the PR and between 7492cb9577 and de17763260.

📒 Files selected for processing (39)
  • CMakeLists.txt
  • assets/localization/ar-AE.json
  • assets/localization/cs-CZ.json
  • assets/localization/da-DK.json
  • assets/localization/de-DE.json
  • assets/localization/el-GR.json
  • assets/localization/en-GB.json
  • assets/localization/en-US.json
  • assets/localization/es-419.json
  • assets/localization/es-ES.json
  • assets/localization/fi-FI.json
  • assets/localization/fr-CA.json
  • assets/localization/fr-FR.json
  • assets/localization/hu-HU.json
  • assets/localization/id-ID.json
  • assets/localization/it-IT.json
  • assets/localization/ja-JP.json
  • assets/localization/ko-KR.json
  • assets/localization/nl-NL.json
  • assets/localization/no-NO.json
  • assets/localization/pl-PL.json
  • assets/localization/pt-BR.json
  • assets/localization/pt-PT.json
  • assets/localization/ro-RO.json
  • assets/localization/ru-RU.json
  • assets/localization/sv-SE.json
  • assets/localization/th-TH.json
  • assets/localization/tr-TR.json
  • assets/localization/vi-VN.json
  • assets/localization/zh-Hans.json
  • assets/localization/zh-Hant.json
  • docs/trophy-localization.md
  • src/common/trophies.cpp
  • src/common/trophyStrings.cpp
  • src/common/trophyStrings.h
  • src/graphics/presentation/systemOverlay.cpp
  • src/launcher/CMakeLists.txt
  • src/launcher/src/trophyViewerDialog.cpp
  • tests/TrophySystemTests.cpp

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 21:58 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#pullrequestreview-5435017714) · **reviewed** **Actionable comments posted: 4** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `345c166c-87c6-4532-b323-34f1c8dad91a` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between 7492cb95777b19fbacdf91f999fcc37b0a8b81c5 and de177632607fe345b85941902ed79238f136c7c9. </details> <details> <summary>📒 Files selected for processing (39)</summary> * `CMakeLists.txt` * `assets/localization/ar-AE.json` * `assets/localization/cs-CZ.json` * `assets/localization/da-DK.json` * `assets/localization/de-DE.json` * `assets/localization/el-GR.json` * `assets/localization/en-GB.json` * `assets/localization/en-US.json` * `assets/localization/es-419.json` * `assets/localization/es-ES.json` * `assets/localization/fi-FI.json` * `assets/localization/fr-CA.json` * `assets/localization/fr-FR.json` * `assets/localization/hu-HU.json` * `assets/localization/id-ID.json` * `assets/localization/it-IT.json` * `assets/localization/ja-JP.json` * `assets/localization/ko-KR.json` * `assets/localization/nl-NL.json` * `assets/localization/no-NO.json` * `assets/localization/pl-PL.json` * `assets/localization/pt-BR.json` * `assets/localization/pt-PT.json` * `assets/localization/ro-RO.json` * `assets/localization/ru-RU.json` * `assets/localization/sv-SE.json` * `assets/localization/th-TH.json` * `assets/localization/tr-TR.json` * `assets/localization/vi-VN.json` * `assets/localization/zh-Hans.json` * `assets/localization/zh-Hant.json` * `docs/trophy-localization.md` * `src/common/trophies.cpp` * `src/common/trophyStrings.cpp` * `src/common/trophyStrings.h` * `src/graphics/presentation/systemOverlay.cpp` * `src/launcher/CMakeLists.txt` * `src/launcher/src/trophyViewerDialog.cpp` * `tests/TrophySystemTests.cpp` </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=53c1fb6d-1614-41c3-91a7-7dda9a3cc349 attempt=7a4183fe-867d-44b2-8dd3-6b553c04826f batch=1/1 -->
@ -0,0 +113,4 @@
i += length;
}
return result;
}
Author
Owner

@⁠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.

Decode does 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 with 0xD8, produces a partial code point. i += length then moves past text.size(), which ends the loop safely. However, the bad code point is still appended. Append can then encode a value that the input never contained. A stray byte in the range 0x80–0xBF is 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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 22:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4201170814) · edited 2026-10-06 22:59 UTC **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** **Bound truncated UTF-8 sequences in `Decode`.** `Decode` does 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 with `0xD8`, produces a partial code point. `i += length` then moves past `text.size()`, which ends the loop safely. However, the bad code point is still appended. `Append` can then encode a value that the input never contained. A stray byte in the range `0x80`–`0xBF` is 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. <!-- coderabbit-global-learning v1 gid=c04e9fd345449fdd scope=protocol --> <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:101cf82ea672cea46e224942 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit f5525b8
@ -0,0 +228,4 @@
Append(out, ltr ? cps[k] : Mirror(cps[k]));
}
end = begin;
}
Author
Owner

@⁠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

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 22:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4201170822) · 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. <!-- fingerprinting:phantom:medusa:pangolin --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:d3d3aa5cee16efb935fed965 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit f5525b8
@ -1105,0 +1227,4 @@
i += 2;
} else {
word += name[i];
}
Author
Owner

@⁠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:

sed -n '1160,1240p' src/graphics/presentation/systemOverlay.cpp

Repository: KytyPS5/KytyPS5

Length of output: 3752


🏁 Script executed:

printf '%s\n' '--- current rendering tail ---'
sed -n '1230,1325p' src/graphics/presentation/systemOverlay.cpp
printf '%s\n' '--- base-to-head diff for title wrapping/rendering ---'
git diff --unified=12 6ef406542c77671f199c0978c8dfc5f267613ff7 d1b234c192b23d5d23cbc3a8470c8b7ac5261f79 -- src/graphics/presentation/systemOverlay.cpp | sed -n '/Greedy word wrap/,+125p'

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 checking fits. 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
-				} else if (byte >= 0xE3 && byte <= 0xE9 && i + 2 < name.size()) {
+				} else if (byte >= 0xE0 && byte <= 0xE9 && i + 2 < name.size()) {
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

			bool       space_before = false;
			const auto flush_word   = [&] {
				if (word.empty()) {
					return;
				}
				const auto candidate = line.empty() ? word : line + (space_before ? " " : "") + word;
				if (line.empty() || fits(candidate)) {
					line = candidate;
				} else {
					title_lines.push_back(line);
					line = word;
				}
				word.clear();
			};
			// Chinese, Japanese and similar text has no spaces, so it may break between characters.
			const auto& name = trophy_notification->name;
			for (size_t i = 0; i < name.size(); ++i) {
				const auto byte = static_cast<unsigned char>(name[i]);
				if (name[i] == ' ') {
					flush_word();
					space_before = true;
				} else if (byte >= 0xE0 && byte <= 0xE9 && i + 2 < name.size()) {
					flush_word();
					space_before = false;
					word.assign(name, i, 3);
					flush_word();
					i += 2;
				} else {
					word += name[i];
				}

✅ Addressed in commit f5525b8

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 22:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#discussion_r4201170827) · edited 2026-10-06 22:59 UTC **🎯 Functional Correctness** | **🟡 Minor** | **⚡ Quick win** <details> <summary>🔎 Supported by static analysis</summary> 🏁 Script executed: ```bash sed -n '1160,1240p' src/graphics/presentation/systemOverlay.cpp ``` Repository: KytyPS5/KytyPS5 Length of output: 3752 --- 🏁 Script executed: ```bash printf '%s\n' '--- current rendering tail ---' sed -n '1230,1325p' src/graphics/presentation/systemOverlay.cpp printf '%s\n' '--- base-to-head diff for title wrapping/rendering ---' git diff --unified=12 6ef406542c77671f199c0978c8dfc5f267613ff7 d1b234c192b23d5d23cbc3a8470c8b7ac5261f79 -- src/graphics/presentation/systemOverlay.cpp | sed -n '/Greedy word wrap/,+125p' ``` Repository: KytyPS5/KytyPS5 Length of output: 11330 --- </details> **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 checking `fits`. 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. <details> <summary>🐛 Suggested fix</summary> ```diff - } else if (byte >= 0xE3 && byte <= 0xE9 && i + 2 < name.size()) { + } else if (byte >= 0xE0 && byte <= 0xE9 && i + 2 < name.size()) { ``` </details> <!-- suggestion_start --> <details> <summary>📝 Committable suggestion</summary> > ‼️ **IMPORTANT** > Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements. ```suggestion bool space_before = false; const auto flush_word = [&] { if (word.empty()) { return; } const auto candidate = line.empty() ? word : line + (space_before ? " " : "") + word; if (line.empty() || fits(candidate)) { line = candidate; } else { title_lines.push_back(line); line = word; } word.clear(); }; // Chinese, Japanese and similar text has no spaces, so it may break between characters. const auto& name = trophy_notification->name; for (size_t i = 0; i < name.size(); ++i) { const auto byte = static_cast<unsigned char>(name[i]); if (name[i] == ' ') { flush_word(); space_before = true; } else if (byte >= 0xE0 && byte <= 0xE9 && i + 2 < name.size()) { flush_word(); space_before = false; word.assign(name, i, 3); flush_word(); i += 2; } else { word += name[i]; } ``` </details> <!-- suggestion_end --> <!-- fingerprinting:phantom:medusa:beignet55 --> <!-- cr-indicator-types:potential_issue --> <!-- cr-comment:v1:90a020d7200821d053f593a4 --> <!-- This is an auto-generated comment by CodeRabbit --> ✅ Addressed in commit f5525b8
Author
Owner

@⁠coderabbitai[bot] on GitHub · 2026-10-06 22:49 UTC · original · reviewed

Actionable comments posted: 3


ℹ️ Review info
⚙️ Run configuration
  • Configuration used: Repository: KytyPS5/KytyPS5/.coderabbit.yaml
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: db853354-77bb-49aa-a372-eb9c175a3343
📥 Commits

Reviewing files that changed from the base of the PR and between de17763260 and d1b234c192.

📒 Files selected for processing (5)
  • docs/trophy-localization.md
  • src/common/textShaping.cpp
  • src/common/textShaping.h
  • src/graphics/presentation/systemOverlay.cpp
  • tests/TrophySystemTests.cpp
🚧 Files skipped from review as they are similar to previous changes (2)
  • tests/TrophySystemTests.cpp
  • docs/trophy-localization.md

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review.

**@⁠coderabbitai[bot]** on GitHub · 2026-10-06 22:49 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#pullrequestreview-5435384204) · **reviewed** **Actionable comments posted: 3** --- <details> <summary>ℹ️ Review info</summary> <details> <summary>⚙️ Run configuration</summary> - **Configuration used**: Repository: KytyPS5/KytyPS5/.coderabbit.yaml - **Review profile**: CHILL - **Plan**: Advanced - **Run ID**: `db853354-77bb-49aa-a372-eb9c175a3343` </details> <details> <summary>📥 Commits</summary> Reviewing files that changed from the base of the PR and between de177632607fe345b85941902ed79238f136c7c9 and d1b234c192b23d5d23cbc3a8470c8b7ac5261f79. </details> <details> <summary>📒 Files selected for processing (5)</summary> * `docs/trophy-localization.md` * `src/common/textShaping.cpp` * `src/common/textShaping.h` * `src/graphics/presentation/systemOverlay.cpp` * `tests/TrophySystemTests.cpp` </details> <details> <summary>🚧 Files skipped from review as they are similar to previous changes (2)</summary> * tests/TrophySystemTests.cpp * docs/trophy-localization.md </details> **Included review availability:** This review used your included allowance. Your plan provides up to 8 included reviews per hour; 6 remain after this review. </details> <!-- This is an auto-generated comment by CodeRabbit for review status --> <!-- coderabbit-review-publication v1 publication=e3a6b76c-3fdb-4f5f-b6a7-cc046155b5d9 attempt=7eddfdc0-18b6-4f71-b722-5d0d3b15af06 batch=1/1 -->
Author
Owner

@⁠Nmzik on GitHub · 2026-10-08 14:54 UTC · original

all fixes have been merged except localization support.

**@⁠Nmzik** on GitHub · 2026-10-08 14:54 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#issuecomment-6062594458) all fixes have been merged except localization support.
Author
Owner

@⁠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

**@⁠gandalfthewhite19890404** on GitHub · 2026-10-14 02:36 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#issuecomment-6159627149) Why localization was not merged? Anyone can continue it? Or you're against other languages
Author
Owner

@⁠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 13:24 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#issuecomment-6216470224) @⁠gandalfthewhite19890404 @⁠Pipe530 Closed by mistake. I'll try to find a way to pack localizations files
Author
Owner

@⁠Nmzik on GitHub · 2026-10-16 14:20 UTC · original

Merged localization. JSONs are embedded

**@⁠Nmzik** on GitHub · 2026-10-16 14:20 UTC · [original](https://github.com/KytyPS5/KytyPS5/pull/1126#issuecomment-6217520367) Merged localization. JSONs are embedded

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.