[PR #5643] [MERGED] Localization: the title footer and the Extras page read the language table, and a test checks the lang files #6410

Closed
opened 2026-11-03 06:20:08 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/5643
Author: @mariuslozo-boop
Created: 11/1/2026
Status: ✅ Merged
Merged: 11/1/2026
Merged by: @ludovic111

Base: main ← Head: i18n/horizon-strings-a


📝 Commits (6)

  • b3209dd Localization: the title footer and the Extras page read the language table
  • 570e3c9 Localization: test the bundled horizon lang files against en_us
  • cddfdce Localization: the lang test checks every key the code names, CRLF or not
  • aec9421 Merge main into #5643: the Extras page's Splitscreen switch gets its language keys
  • 5d01df7 Merge main into #5643: Hide block-break particles, UI sound reserve and their headers read the language table
  • 79b92a3 Merge main into #5643: the new Chat rows read the language table

📊 Changes

5 files changed (+253 additions, -16 deletions)

View changed files

📝 crates/horizon-client-core/src/lang.rs (+142 -0)
📝 crates/horizon-client-render/src/extras.rs (+63 -11)
📝 crates/horizon-client-render/src/options_ui.rs (+3 -3)
📝 crates/horizon-client/assets/horizon/lang/en_us.json (+41 -1)
📝 crates/horizon-client/src/title.rs (+4 -1)

📄 Description

🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally.

What and why

Refs #1927 (1 of 3). Some of Horizon's own captions never reached the language table, so they stayed English in every language:

  • the title screen's "Not affiliated with Mojang or Microsoft";
  • the whole Extras page: the four section headers, the eleven captions, their tooltips, and the On/Off values.

They now read horizon.title.not_affiliated and horizon.extras.* from the bundled horizon namespace. Lookups use lang::get_or with the English text as fallback. The headers use the page's existing tr(key). en_us.json gains 27 keys, each with exactly the English text it replaces, so English looks the same and horizon-ctl's widget ids (slugs of the labels) don't change. Other languages show English until they translate these keys.

A test keeps the bundled files honest. For each bundled lang file it checks:

  • Bundled::read serves it (an unserved file is never loaded);
  • it parses as a flat map with no repeated key;
  • every key is in en_us.json (no stale or renamed keys);
  • the placeholders are the ones in the English text.

A second test checks that every horizon.<group>.<name> key the client's sources name is in en_us.json. A language need not be complete: a missing key falls back to English.

Kind

  • parity: Horizon now does what vanilla 26.3 does
  • bug: a crash or a breakage
  • perf: faster, or less memory
  • feature: something new for players (listed under New in the release notes)
  • extra: Horizon-only, off by default
  • tooling: tools, CI, tests, harnesses
  • docs

Vanilla reference

Horizon-only (Horizon's own captions). The table follows ClientLanguage.loadFrom: en_us first, then the selected language.

Other projects' code

none

Self-check

  • lang::tests::bundled_files_are_served_and_have_no_stale_or_repeated_keys fails on an added stale key (pl_pl: horizon.stale.key is not in en_us.json).
  • lang::tests::every_horizon_key_the_code_names_is_in_en_us fails when horizon.title.not_affiliated is taken out of en_us.json.
  • Both pass on a CRLF checkout (Git for Windows' core.autocrlf=true).
  • A script compared every get_or(key, english) in the changed files with en_us.json: none differs.

pr_ready (tools/pr_ready.py --base upstream/main on PCDKBLENDER, against upstream/main at 78043f09a, 12 min 9 s)

Check Result
Scope ✅ 5 files, +227 −13
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ✅ 511 passed (50 s)
rustfmt ✅ (8 s)
clippy ✅ (16 s)
tests: horizon-client, horizon-client-core, horizon-client-render ✅ 2539 passed (10 min 47 s)
doc tests ✅ 0 passed (4 s)
content root tests ➖ content root untouched
tokens.css up to date ➖ theme untouched
launcher rustfmt ➖ launcher untouched
launcher clippy ➖ launcher untouched
launcher tests ➖ launcher untouched
Parity ❌ 373 affected, (1 s)
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)
  • Parity: this was run on Windows, where the runner needs fcntl and can't start. The affected harnesses run in CI (run-parity).
  • Tests: run with RUST_TEST_THREADS=2. On this Windows machine, 4 or more horizon-client-render GPU tests at once hang (they pass alone and with 2 threads); the renderer is untouched here.

Screenshots

English is unchanged. With the translations of the third PR, the Extras page and the title footer in German and French:

(attach .local/agent-i18n/de_de/shots/options-extras.png, fr_fr/shots/options-extras.png, de_de/shots/title.png)

🤖 Generated with Claude Code

https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB


🔄 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/5643 **Author:** [@mariuslozo-boop](https://github.com/mariuslozo-boop) **Created:** 11/1/2026 **Status:** ✅ Merged **Merged:** 11/1/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `i18n/horizon-strings-a` --- ### 📝 Commits (6) - [`b3209dd`](https://github.com/horizon-rust/horizon/commit/b3209dd9b9bfdc78f393435e99c559b9a5af75bf) Localization: the title footer and the Extras page read the language table - [`570e3c9`](https://github.com/horizon-rust/horizon/commit/570e3c9656b6e464dad31a293b5e586f4a4dff3b) Localization: test the bundled horizon lang files against en_us - [`cddfdce`](https://github.com/horizon-rust/horizon/commit/cddfdcea3461aa6c973f8f7aaa91098d4730f2e9) Localization: the lang test checks every key the code names, CRLF or not - [`aec9421`](https://github.com/horizon-rust/horizon/commit/aec9421cf3d14339dd173838a563ce05d4cd1230) Merge main into #5643: the Extras page's Splitscreen switch gets its language keys - [`5d01df7`](https://github.com/horizon-rust/horizon/commit/5d01df7504f0eef3ffa1fc80006ca9a97eea1874) Merge main into #5643: Hide block-break particles, UI sound reserve and their headers read the language table - [`79b92a3`](https://github.com/horizon-rust/horizon/commit/79b92a3f8f5593341ad30a2f40cc7d0b948f1a25) Merge main into #5643: the new Chat rows read the language table ### 📊 Changes **5 files changed** (+253 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-core/src/lang.rs` (+142 -0) 📝 `crates/horizon-client-render/src/extras.rs` (+63 -11) 📝 `crates/horizon-client-render/src/options_ui.rs` (+3 -3) 📝 `crates/horizon-client/assets/horizon/lang/en_us.json` (+41 -1) 📝 `crates/horizon-client/src/title.rs` (+4 -1) </details> ### 📄 Description > 🤖 Opened by mariuslozo-boop's AI agent (Claude Code, Claude Sonnet 5.5 + Claude Opus 5.5 review), not by mariuslozo-boop personally. ## What and why Refs #1927 (1 of 3). Some of Horizon's own captions never reached the language table, so they stayed English in every language: - the title screen's "Not affiliated with Mojang or Microsoft"; - the whole Extras page: the four section headers, the eleven captions, their tooltips, and the On/Off values. They now read `horizon.title.not_affiliated` and `horizon.extras.*` from the bundled `horizon` namespace. Lookups use `lang::get_or` with the English text as fallback. The headers use the page's existing `tr(key)`. en_us.json gains 27 keys, each with exactly the English text it replaces, so English looks the same and horizon-ctl's widget ids (slugs of the labels) don't change. Other languages show English until they translate these keys. A test keeps the bundled files honest. For each bundled lang file it checks: - `Bundled::read` serves it (an unserved file is never loaded); - it parses as a flat map with no repeated key; - every key is in en_us.json (no stale or renamed keys); - the placeholders are the ones in the English text. A second test checks that every `horizon.<group>.<name>` key the client's sources name is in en_us.json. A language need not be complete: a missing key falls back to English. ## Kind - [ ] parity: Horizon now does what vanilla 26.3 does - [x] bug: a crash or a breakage - [ ] perf: faster, or less memory - [ ] feature: something new for players (listed under New in the release notes) - [ ] extra: Horizon-only, off by default - [ ] tooling: tools, CI, tests, harnesses - [ ] docs ## Vanilla reference Horizon-only (Horizon's own captions). The table follows `ClientLanguage.loadFrom`: en_us first, then the selected language. ## Other projects' code none ## Self-check - `lang::tests::bundled_files_are_served_and_have_no_stale_or_repeated_keys` fails on an added stale key (`pl_pl: horizon.stale.key is not in en_us.json`). - `lang::tests::every_horizon_key_the_code_names_is_in_en_us` fails when `horizon.title.not_affiliated` is taken out of en_us.json. - Both pass on a CRLF checkout (Git for Windows' `core.autocrlf=true`). - A script compared every `get_or(key, english)` in the changed files with en_us.json: none differs. **pr_ready** (`tools/pr_ready.py --base upstream/main` on PCDKBLENDER, against upstream/main at 78043f09a, 12 min 9 s) | Check | Result | | --- | --- | | Scope | ✅ 5 files, +227 −13 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ✅ 511 passed (50 s) | | rustfmt | ✅ (8 s) | | clippy | ✅ (16 s) | | tests: horizon-client, horizon-client-core, horizon-client-render | ✅ 2539 passed (10 min 47 s) | | doc tests | ✅ 0 passed (4 s) | | content root tests | ➖ content root untouched | | tokens.css up to date | ➖ theme untouched | | launcher rustfmt | ➖ launcher untouched | | launcher clippy | ➖ launcher untouched | | launcher tests | ➖ launcher untouched | | Parity | ❌ 373 affected, (1 s) | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | - Parity: this was run on Windows, where the runner needs `fcntl` and can't start. The affected harnesses run in CI (`run-parity`). - Tests: run with `RUST_TEST_THREADS=2`. On this Windows machine, 4 or more `horizon-client-render` GPU tests at once hang (they pass alone and with 2 threads); the renderer is untouched here. ## Screenshots English is unchanged. With the translations of the third PR, the Extras page and the title footer in German and French: (attach `.local/agent-i18n/de_de/shots/options-extras.png`, `fr_fr/shots/options-extras.png`, `de_de/shots/title.png`) 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01RodDbPWCByh96WKcbiEQpB --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 06:20:08 +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#6410
No description provided.