Add a compile-time i18n system with 270 translation keys across 5 locales (EN, DE, FR, ES, PT). Translations are embedded via include_str! and parsed lazily into flat HashMaps with English fallback for missing keys. - Add src/i18n module with Locale enum, t()/tw() lookup functions, and tests - Add JSON translation files for all 5 locales under assets/i18n/ - Provide locale Signal via Dioxus context in App, persisted to localStorage - Replace all hardcoded UI strings across 33 component/page files - Add compact locale picker (globe icon + ISO alpha-2 code) in sidebar header - Add click-outside backdrop dismissal for locale dropdown Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Co-authored-by: Sharang Parnerkar <parnerkarsharang@gmail.com> Reviewed-on: #12
46 lines
1.0 KiB
Rust
46 lines
1.0 KiB
Rust
mod agents;
|
|
mod analytics;
|
|
mod flow;
|
|
|
|
pub use agents::*;
|
|
pub use analytics::*;
|
|
pub use flow::*;
|
|
|
|
use dioxus::prelude::*;
|
|
|
|
use crate::app::Route;
|
|
use crate::components::sub_nav::{SubNav, SubNavItem};
|
|
use crate::i18n::{t, Locale};
|
|
|
|
/// Shell layout for the Developer section.
|
|
///
|
|
/// Renders a horizontal tab bar (Agents, Flow, Analytics) above
|
|
/// the child route outlet. Sits inside the main `AppShell` layout.
|
|
#[component]
|
|
pub fn DeveloperShell() -> Element {
|
|
let locale = use_context::<Signal<Locale>>();
|
|
let l = *locale.read();
|
|
|
|
let tabs = vec![
|
|
SubNavItem {
|
|
label: t(l, "nav.agents"),
|
|
route: Route::AgentsPage {},
|
|
},
|
|
SubNavItem {
|
|
label: t(l, "nav.flow"),
|
|
route: Route::FlowPage {},
|
|
},
|
|
SubNavItem {
|
|
label: t(l, "nav.analytics"),
|
|
route: Route::AnalyticsPage {},
|
|
},
|
|
];
|
|
|
|
rsx! {
|
|
div { class: "developer-shell",
|
|
SubNav { items: tabs }
|
|
div { class: "shell-content", Outlet::<Route> {} }
|
|
}
|
|
}
|
|
}
|