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]