[PR #2798] [MERGED] lang: opening Options lists the languages without reading every file #4622

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

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/2798
Author: @iLostName
Created: 10/27/2026
Status: ✅ Merged
Merged: 10/29/2026
Merged by: @ludovic111

Base: main ← Head: options-languages-without-reading


📝 Commits (1)

  • b042426 lang: opening Options lists the languages without reading every file

📊 Changes

1 file changed (+30 additions, -1 deletions)

View changed files

📝 crates/horizon-client-core/src/lang.rs (+30 -1)

📄 Description

What and why

Opening Options (title, pause or startup menu) froze the window: it read all 144 language files (87 MB) only to check that each exists, about 100 ms warm here and much more cold. It now checks that the file is there without reading it (8 ms for all of them).

Vanilla reference

None: the existence check is Horizon's own (lang::available); the languages it offers are unchanged.

Self-check

pr_ready (tools/pr_ready.py --quick on PC-Lost, against origin/main at 12e0094f1, 1 min 35 s)

Check Result
Scope ✅ 8 files, +77 −1
Cargo.lock ✅ unchanged
Public tree ✅
Python tests ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (49 s)
rustfmt ✅ (9 s)
clippy ❌ failed (28 s)
tests: horizon-client-core ✅ 38 passed (3 s)
doc tests ✅ 0 passed (2 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 ➖ not run (--quick): CI's parity job picks the affected harnesses
Label player-facing: feature if players get something new, no label for a fix (release-now if urgent)

Run on Windows: the Python tests fail there and are unrelated; clippy stops at the duplicate minecraft:rabbit arm in entity_nbt.rs:502, already on main (#2719 fixes it). Scope counts untracked local files.


🔄 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/2798 **Author:** [@iLostName](https://github.com/iLostName) **Created:** 10/27/2026 **Status:** ✅ Merged **Merged:** 10/29/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `options-languages-without-reading` --- ### 📝 Commits (1) - [`b042426`](https://github.com/horizon-rust/horizon/commit/b0424261807336e7f34f495115beffd07e80646b) lang: opening Options lists the languages without reading every file ### 📊 Changes **1 file changed** (+30 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-client-core/src/lang.rs` (+30 -1) </details> ### 📄 Description ## What and why Opening Options (title, pause or startup menu) froze the window: it read all 144 language files (87 MB) only to check that each exists, about 100 ms warm here and much more cold. It now checks that the file is there without reading it (8 ms for all of them). ## Vanilla reference None: the existence check is Horizon's own (`lang::available`); the languages it offers are unchanged. ## Self-check **pr_ready** (`tools/pr_ready.py --quick` on PC-Lost, against origin/main at 12e0094f1, 1 min 35 s) | Check | Result | | --- | --- | | Scope | ✅ 8 files, +77 −1 | | Cargo.lock | ✅ unchanged | | Public tree | ✅ | | Python tests | ❌ 331 run, FAILED (failures=2, errors=8, skipped=11) (49 s) | | rustfmt | ✅ (9 s) | | clippy | ❌ failed (28 s) | | tests: horizon-client-core | ✅ 38 passed (3 s) | | doc tests | ✅ 0 passed (2 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 | ➖ not run (--quick): CI's parity job picks the affected harnesses | | Label | player-facing: `feature` if players get something new, no label for a fix (`release-now` if urgent) | Run on Windows: the Python tests fail there and are unrelated; clippy stops at the duplicate `minecraft:rabbit` arm in `entity_nbt.rs:502`, already on main (#2719 fixes it). Scope counts untracked local files. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 05:06:44 +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#4622
No description provided.