From f28722fb15d8a65f2b2c2c64e6d2c9305e64f1ae Mon Sep 17 00:00:00 2001 From: Ludovic Marie <136255825+ludovic111@users.noreply.github.com> Date: Sun, 25 Oct 2026 09:34:24 +0100 Subject: [PATCH] Lang: drop horizon.menu.friends, vanilla has gui.friends.open TitleScreen's Friends button is vanilla's FriendsButton, whose message is gui.friends.open ("Friends" in en_us, translated in every language the prepared resources carry), so Horizon needs no key of its own for it. Bundled now sits after the trait it implements. Co-Authored-By: Claude Opus 5.5 --- .../assets/horizon/lang/en_us.json | 1 - .../assets/horizon/lang/ru_ru.json | 1 - crates/horizon-client/src/lang.rs | 18 ++++++++---------- 3 files changed, 8 insertions(+), 12 deletions(-) diff --git a/crates/horizon-client/assets/horizon/lang/en_us.json b/crates/horizon-client/assets/horizon/lang/en_us.json index 056162553..de02589e5 100644 --- a/crates/horizon-client/assets/horizon/lang/en_us.json +++ b/crates/horizon-client/assets/horizon/lang/en_us.json @@ -1,5 +1,4 @@ { - "horizon.menu.friends": "Friends", "horizon.options.controller": "Controller", "horizon.options.vibration": "Vibration", "horizon.options.adaptive_triggers": "Adaptive Triggers", diff --git a/crates/horizon-client/assets/horizon/lang/ru_ru.json b/crates/horizon-client/assets/horizon/lang/ru_ru.json index 1152f3669..422fbbc1d 100644 --- a/crates/horizon-client/assets/horizon/lang/ru_ru.json +++ b/crates/horizon-client/assets/horizon/lang/ru_ru.json @@ -1,5 +1,4 @@ { - "horizon.menu.friends": "Друзья", "horizon.options.controller": "Геймпад", "horizon.options.vibration": "Вибрация", "horizon.options.adaptive_triggers": "Адаптивные триггеры", diff --git a/crates/horizon-client/src/lang.rs b/crates/horizon-client/src/lang.rs index f761e1199..94ec4b7ab 100644 --- a/crates/horizon-client/src/lang.rs +++ b/crates/horizon-client/src/lang.rs @@ -29,6 +29,14 @@ pub const DEFAULT: &str = "en_us"; static CURRENT: RwLock>> = RwLock::new(None); +/// A source of resource files: the prepared root plus packs, highest priority last. +pub trait ResourceSource { + fn read(&self, path: &str) -> Option>; + /// The namespaces under `assets/` (resource packs may add their own). + fn namespaces(&self) -> Vec { + vec!["minecraft".into()] + } +} /// Horizon's own strings, compiled in so they need no prepared resources. struct Bundled; impl ResourceSource for Bundled { @@ -44,15 +52,6 @@ impl ResourceSource for Bundled { vec!["horizon".into()] } } - -/// A source of resource files: the prepared root plus packs, highest priority last. -pub trait ResourceSource { - fn read(&self, path: &str) -> Option>; - /// The namespaces under `assets/` (resource packs may add their own). - fn namespaces(&self) -> Vec { - vec!["minecraft".into()] - } -} impl ResourceSource for std::path::PathBuf { fn read(&self, path: &str) -> Option> { std::fs::read(self.join(path)).ok() @@ -234,7 +233,6 @@ mod tests { assert_eq!(en.get("horizon.options.controller"), Some("Controller")); let ru = Language::load(&[&empty], "ru_ru"); assert_eq!(ru.get("horizon.options.controller"), Some("Геймпад")); - assert_eq!(ru.get("horizon.menu.friends"), Some("Друзья")); } #[test]