[PR #1594] [MERGED] Language: the prepared resources carry every bundled language and the list #3615

Closed
opened 2026-11-03 04:10:50 +07:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/horizon-rust/horizon/pull/1594
Author: @Domanffe
Created: 10/24/2026
Status: ✅ Merged
Merged: 10/24/2026
Merged by: @ludovic111

Base: main ← Head: feat/bundled-languages


📝 Commits (3)

  • 3802a97 Language: the prepared resources carry every bundled language and the list
  • adcfe81 rustfmt
  • c6980fb Drop the lang.rs test: layers_selected_language_over_english covers it

📊 Changes

3 files changed (+80 additions, -6 deletions)

View changed files

📝 crates/horizon-prepare/src/lib.rs (+1 -1)
📝 crates/horizon-prepare/src/main.rs (+12 -3)
📝 crates/horizon-prepare/src/sounds.rs (+67 -2)

📄 Description

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

Fixes #1272.

What and why

The language screen offered English alone, and the reason is in the prepared resources rather than in lang.rs: a prepared root holds assets/minecraft/lang/en_us.json and deprecated.json and nothing else, and has no pack.mcmeta anywhere.

Both are true of the client jar itself. I opened the pinned client jar of a launcher install: 34,227 entries, three of them under lang/ (deprecated.json, en_us.json, and the directory), and no pack.mcmeta at the root or under assets/. horizon-prepare copies assets/, data/ and pack.png from that jar, so every other language was never on disk, and lang::available fell back to its built-in English entry because the metadata it reads was missing too.

The asset index has them: 5,147 entries on this machine, 143 of them minecraft/lang/<code>.json (ru_ru.json included) plus a top-level pack.mcmeta carrying the language section. So the import goes where the sounds, the title panorama, Unifont and the built-in packs already go:

  • horizon-prepare languages copies pack.mcmeta and every minecraft/lang/*.json from the asset store into assets/, with the checksum check and the log line every other entry point has.
  • Full preparation calls it with the other three (optional_assets), so a fresh prepare is complete, and it can be re-run alone on existing resources without Java.
  • main.rs takes languages as a subcommand, listed in HELP.

With the metadata in place, lang::available offers every language the client declares, Русский (Россия) among them, and picking one loads that file over en_us. lang in options.txt already round-trips, so nothing else was missing. The launcher replaces resources whose preparer sources changed (resources_compatible compares crates/horizon-prepare), so an existing install picks this up on its next update without anyone running --prepare by hand.

Horizon's own launcher-and-menu strings are not vanilla translation keys, so they stay English; this fixes the game's text, which is what the issue asks for.

Vanilla reference

ClientLanguage builds the offered list from the language section of every enabled pack's pack.mcmeta, the vanilla pack being the client jar's asset root; each entry is a code with name, region and bidirectional, and a code is offered only when its assets/minecraft/lang/<code>.json exists. lang::available already implements those rules and the en_us layering below the selection; this change only gives it the files, from the same store vanilla's launcher downloads them from.

Self-check

pr_ready is running on this machine and its block goes into a comment here as soon as it finishes (the launcher clippy pass alone takes about ten minutes).

Two new tests cover this: sounds::tests::languages_come_from_the_asset_store for the import (its fixture store gains the index entries it needs) and lang::tests::a_prepared_root_offers_the_languages_the_asset_index_holds for the reading side, which asserts the list holds Русский (Россия) and that Language::load returns Яблоко from the file.

The prepare side needs the vanilla jars, so it runs on your machine or CI. The failures in the block are Windows ones I can point at: the client and launcher clippy runs die on pre-existing dead-code warnings (link_stays_inside in launcher/src/mojang.rs, boxed_local in streaming.rs), and the three failing client tests (save::session_lock_is_exclusive, packs::cache::...owned_output_recovery, crash::...panicking_frame) fail identically on a clean tree here and pass on macOS; #1573 was checked the same way.

🤖 Generated with Hermes Agent (Nous Research)


🔄 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/1594 **Author:** [@Domanffe](https://github.com/Domanffe) **Created:** 10/24/2026 **Status:** ✅ Merged **Merged:** 10/24/2026 **Merged by:** [@ludovic111](https://github.com/ludovic111) **Base:** `main` ← **Head:** `feat/bundled-languages` --- ### 📝 Commits (3) - [`3802a97`](https://github.com/horizon-rust/horizon/commit/3802a97dc9b25cfc4ed0117e7e894305cf917f3e) Language: the prepared resources carry every bundled language and the list - [`adcfe81`](https://github.com/horizon-rust/horizon/commit/adcfe810f293df8695ad9ef4f0d6626b64036d8b) rustfmt - [`c6980fb`](https://github.com/horizon-rust/horizon/commit/c6980fb2b770470de69ae380f044b39f1d55b21b) Drop the lang.rs test: layers_selected_language_over_english covers it ### 📊 Changes **3 files changed** (+80 additions, -6 deletions) <details> <summary>View changed files</summary> 📝 `crates/horizon-prepare/src/lib.rs` (+1 -1) 📝 `crates/horizon-prepare/src/main.rs` (+12 -3) 📝 `crates/horizon-prepare/src/sounds.rs` (+67 -2) </details> ### 📄 Description > 🤖 Opened by Alexander's AI agent (Hermes), not by Alexander himself. Fixes #1272. ## What and why The language screen offered English alone, and the reason is in the prepared resources rather than in `lang.rs`: a prepared root holds `assets/minecraft/lang/en_us.json` and `deprecated.json` and nothing else, and has no `pack.mcmeta` anywhere. Both are true of the client jar itself. I opened the pinned client jar of a launcher install: 34,227 entries, three of them under `lang/` (`deprecated.json`, `en_us.json`, and the directory), and no `pack.mcmeta` at the root or under `assets/`. `horizon-prepare` copies `assets/`, `data/` and `pack.png` from that jar, so every other language was never on disk, and `lang::available` fell back to its built-in English entry because the metadata it reads was missing too. The asset index has them: 5,147 entries on this machine, 143 of them `minecraft/lang/<code>.json` (`ru_ru.json` included) plus a top-level `pack.mcmeta` carrying the `language` section. So the import goes where the sounds, the title panorama, Unifont and the built-in packs already go: - `horizon-prepare languages` copies `pack.mcmeta` and every `minecraft/lang/*.json` from the asset store into `assets/`, with the checksum check and the log line every other entry point has. - Full preparation calls it with the other three (`optional_assets`), so a fresh prepare is complete, and it can be re-run alone on existing resources without Java. - `main.rs` takes `languages` as a subcommand, listed in `HELP`. With the metadata in place, `lang::available` offers every language the client declares, `Русский (Россия)` among them, and picking one loads that file over `en_us`. `lang` in options.txt already round-trips, so nothing else was missing. The launcher replaces resources whose preparer sources changed (`resources_compatible` compares `crates/horizon-prepare`), so an existing install picks this up on its next update without anyone running `--prepare` by hand. Horizon's own launcher-and-menu strings are not vanilla translation keys, so they stay English; this fixes the game's text, which is what the issue asks for. ## Vanilla reference `ClientLanguage` builds the offered list from the `language` section of every enabled pack's `pack.mcmeta`, the vanilla pack being the client jar's asset root; each entry is a code with `name`, `region` and `bidirectional`, and a code is offered only when its `assets/minecraft/lang/<code>.json` exists. `lang::available` already implements those rules and the `en_us` layering below the selection; this change only gives it the files, from the same store vanilla's launcher downloads them from. ## Self-check `pr_ready` is running on this machine and its block goes into a comment here as soon as it finishes (the launcher clippy pass alone takes about ten minutes). Two new tests cover this: `sounds::tests::languages_come_from_the_asset_store` for the import (its fixture store gains the index entries it needs) and `lang::tests::a_prepared_root_offers_the_languages_the_asset_index_holds` for the reading side, which asserts the list holds `Русский (Россия)` and that `Language::load` returns `Яблоко` from the file. The prepare side needs the vanilla jars, so it runs on your machine or CI. The failures in the block are Windows ones I can point at: the client and launcher clippy runs die on pre-existing dead-code warnings (`link_stays_inside` in `launcher/src/mojang.rs`, `boxed_local` in `streaming.rs`), and the three failing client tests (`save::session_lock_is_exclusive`, `packs::cache::...owned_output_recovery`, `crash::...panicking_frame`) fail identically on a clean tree here and pass on macOS; #1573 was checked the same way. 🤖 Generated with Hermes Agent (Nous Research) --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-03 04:10:50 +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#3615
No description provided.