app

Local-first trade for farms and co-ops
git clone https://radroots.dev/git/app.git
Log | Files | Refs | README | LICENSE

commit 3e9b3055d4c3bfe671d8feda1fca635d26de69be
parent 5c3f732c068e45ddebd585d567a9832a7d60ac60
Author: triesap <tyson@radroots.org>
Date:   Sun, 19 Apr 2026 22:21:36 +0000

i18n: route runtime usage through mf2_i18n

- add the facade crate to the mounted app workspace dependency registry
- switch radroots_app_i18n runtime imports to mf2_i18n with native enabled
- emit generated runtime modules through mf2_i18n::define_i18n_module
- validate with cargo test -p radroots_app_i18n and git diff --check

Diffstat:
MCargo.lock | 13++++++++++++-
MCargo.toml | 1+
Mcrates/shared/i18n/Cargo.toml | 3+--
Mcrates/shared/i18n/build.rs | 2+-
Mcrates/shared/i18n/src/lib.rs | 2+-
5 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/Cargo.lock b/Cargo.lock @@ -3756,6 +3756,17 @@ dependencies = [ ] [[package]] +name = "mf2_i18n" +version = "0.1.0" +dependencies = [ + "mf2_i18n_core", + "mf2_i18n_embedded", + "mf2_i18n_native", + "mf2_i18n_runtime", + "mf2_i18n_std", +] + +[[package]] name = "mf2_i18n_build" version = "0.1.0" dependencies = [ @@ -5061,9 +5072,9 @@ name = "radroots_app_i18n" version = "0.1.0" dependencies = [ "hex", + "mf2_i18n", "mf2_i18n_build", "mf2_i18n_core", - "mf2_i18n_native", "serde", "serde_json", "toml 0.8.23", diff --git a/Cargo.toml b/Cargo.toml @@ -28,6 +28,7 @@ gpui = "0.2.2" gpui-component = "0.5.1" gpui-component-assets = "0.5.1" hex = "0.4" +mf2_i18n = { path = "../../../../vendor/triesap/mf2_i18n/crates/mf2_i18n" } mf2_i18n_build = { path = "../../../../vendor/triesap/mf2_i18n/crates/mf2_i18n_build" } mf2_i18n_core = { path = "../../../../vendor/triesap/mf2_i18n/crates/mf2_i18n_core" } mf2_i18n_native = { path = "../../../../vendor/triesap/mf2_i18n/crates/mf2_i18n_native" } diff --git a/crates/shared/i18n/Cargo.toml b/crates/shared/i18n/Cargo.toml @@ -9,8 +9,7 @@ publish = false build = "build.rs" [dependencies] -mf2_i18n_core.workspace = true -mf2_i18n_native.workspace = true +mf2_i18n = { workspace = true, features = ["native"] } [build-dependencies] hex.workspace = true diff --git a/crates/shared/i18n/build.rs b/crates/shared/i18n/build.rs @@ -236,7 +236,7 @@ fn write_generated_runtime( .collect::<Vec<_>>() .join("\n"); let runtime_source = format!( - "mod generated {{\n mf2_i18n_native::define_i18n_module! {{\n init_policy: strict,\n default_locale: {default_locale:?},\n id_map_json: include_bytes!(concat!(env!(\"OUT_DIR\"), \"/app_i18n/id-map.json\")),\n id_map_hash: include_bytes!(concat!(env!(\"OUT_DIR\"), \"/app_i18n/id-map.sha256\")),\n packs: [\n{packs_source}\n ],\n }}\n}}\n" + "mod generated {{\n mf2_i18n::define_i18n_module! {{\n init_policy: strict,\n default_locale: {default_locale:?},\n id_map_json: include_bytes!(concat!(env!(\"OUT_DIR\"), \"/app_i18n/id-map.json\")),\n id_map_hash: include_bytes!(concat!(env!(\"OUT_DIR\"), \"/app_i18n/id-map.sha256\")),\n packs: [\n{packs_source}\n ],\n }}\n}}\n" ); fs::write(out_dir.join("generated_module.rs"), runtime_source) .expect("generated runtime module should write"); diff --git a/crates/shared/i18n/src/lib.rs b/crates/shared/i18n/src/lib.rs @@ -1,6 +1,6 @@ #![forbid(unsafe_code)] -use mf2_i18n_core::{LanguageTag, negotiate_lookup}; +use mf2_i18n::{LanguageTag, negotiate_lookup}; mod keys;