[PR #4177] [MERGED] Graphics screens: their text through the language table #5462

Closed
opened 2026-11-03 05:12:45 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/4177
Author: @Domanffe
Created: 10/30/2026
Status: ✅ Merged
Merged: 10/31/2026
Merged by: @rdbtCVS

Base: main ← Head: feat/game-ru-strings


📝 Commits (1)

  • 58cf8aa Graphics screens: their text through the language table

📊 Changes

4 files changed (+304 additions, -23 deletions)

View changed files

📝 crates/horizon-client-render/src/graphics_style.rs (+4 -2)
📝 crates/horizon-client-render/src/graphics_ui.rs (+34 -19)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+133 -1)
📝 crates/horizon-client/assets/horizon/lang/ru_ru.json (+133 -1)

📄 Description

🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself.

The graphics screens (Simple, Advanced, HDR) were the largest untranslated surface in the game: 100 strings, and none of them could reach the language table because they never pass a key. They are English display text handed to a widget, so the widget's text is the key and the table holds the Russian: labelled() translates a control's caption and its value, graphics_style::description translates the sentence before it wraps it, and the section headers, page titles, the two level buttons, the cost tags and the "why this control is blocked" reasons go through lang::get where they are drawn. Values composed with a number became templates the table can hold (%s chunks, Auto (%s nits), %s MiB/frame), which format_translation already reads.

That shape is a trade worth naming: the keys are the English sentences rather than horizon.graphics.* names, because the alternative is rewriting a hundred call sites instead of six. A key the table lacks shows the English sentence, never a key name, so a miss looks like untranslated text rather than a bug on screen.

en_us.json and ru_ru.json gain the same 132 keys: the sentences, the captions, the values (Off, Unlimited, Vulkan, Ultra Performance…) and the templates. pl_pl and uk_ua are untouched — the catalog test requires only that every en_us key exists in ru_ru, and a key missing from Polish falls back to English as before.

What is still English, from the same audit (195 strings in 14 files): the Extras page (33), the Play with Friends screen and its chat lines (17), the connecting screen and its messages (10), pre-generation messages (8), the title screen (4), the loading-stage labels (4), and three in mods. Those are the next slice.

Evidence. cargo test -p horizon-client-core --lib lang (the bundled tables carry every key in both languages), cargo test -p horizon-client-render --lib graphics (the screens' own layout, scrollbar and cycling tests still pass with the lookups in the draw path). Coverage was measured with a throwaway test in graphics_ui that walked rows() for all three levels and asserted every header, description and Horizon caption has a ru_ru entry: 0 missing. It is not in this branch (it reads another crate's asset file), and this paragraph is the record of it.

Not observed: the screens on screen. Building the client and driving it needs the prepared resources and a real window, so the Russian there rests on those tests and on the catalog rather than on a screenshot. That is the one thing this PR does not show.

This replaces the game half of #4173; the launcher half is #4178.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/horizon-rust/horizon/pull/4177 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/30/2026 **Status:** ✅ Merged **Merged:** 10/31/2026 **Merged by:** [@rdbtCVS](https://github.com/rdbtCVS) **Base:** `main` ← **Head:** `feat/game-ru-strings` --- ### 📝 Commits (1) - [`58cf8aa`](https://github.com/horizon-rust/horizon/commit/58cf8aa10cc5bf79a73ebeba753b7b266e7766b3) Graphics screens: their text through the language table ### 📊 Changes **4 files changed** (+304 additions, -23 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-render/src/graphics_style.rs` (+4 -2) 📝 `crates/horizon-client-render/src/graphics_ui.rs` (+34 -19) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+133 -1) 📝 `crates/horizon-client/assets/horizon/lang/ru_ru.json` (+133 -1) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. The graphics screens (Simple, Advanced, HDR) were the largest untranslated surface in the game: 100 strings, and none of them could reach the language table because they never pass a key. They are English display text handed to a widget, so the widget's text is the key and the table holds the Russian: `labelled()` translates a control's caption and its value, `graphics_style::description` translates the sentence before it wraps it, and the section headers, page titles, the two level buttons, the cost tags and the "why this control is blocked" reasons go through `lang::get` where they are drawn. Values composed with a number became templates the table can hold (`%s chunks`, `Auto (%s nits)`, `%s MiB/frame`), which `format_translation` already reads. That shape is a trade worth naming: the keys are the English sentences rather than `horizon.graphics.*` names, because the alternative is rewriting a hundred call sites instead of six. A key the table lacks shows the English sentence, never a key name, so a miss looks like untranslated text rather than a bug on screen. `en_us.json` and `ru_ru.json` gain the same 132 keys: the sentences, the captions, the values (`Off`, `Unlimited`, `Vulkan`, `Ultra Performance`…) and the templates. `pl_pl` and `uk_ua` are untouched — the catalog test requires only that every `en_us` key exists in `ru_ru`, and a key missing from Polish falls back to English as before. **What is still English**, from the same audit (195 strings in 14 files): the Extras page (33), the Play with Friends screen and its chat lines (17), the connecting screen and its messages (10), pre-generation messages (8), the title screen (4), the loading-stage labels (4), and three in `mods`. Those are the next slice. **Evidence.** `cargo test -p horizon-client-core --lib lang` (the bundled tables carry every key in both languages), `cargo test -p horizon-client-render --lib graphics` (the screens' own layout, scrollbar and cycling tests still pass with the lookups in the draw path). Coverage was measured with a throwaway test in `graphics_ui` that walked `rows()` for all three levels and asserted every header, description and Horizon caption has a `ru_ru` entry: 0 missing. It is not in this branch (it reads another crate's asset file), and this paragraph is the record of it. Not observed: the screens on screen. Building the client and driving it needs the prepared resources and a real window, so the Russian there rests on those tests and on the catalog rather than on a screenshot. That is the one thing this PR does not show. This replaces the game half of #4173; the launcher half is #4178. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:12:45 +07:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#5462
No description provided.