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
92 lines
3.4 KiB
Rust
92 lines
3.4 KiB
Rust
use dioxus::prelude::*;
|
|
use dioxus_free_icons::icons::bs_icons::BsShieldCheck;
|
|
use dioxus_free_icons::Icon;
|
|
|
|
use crate::i18n::{t, Locale};
|
|
use crate::Route;
|
|
|
|
/// Privacy Policy page.
|
|
///
|
|
/// Displays the platform's privacy policy. Publicly accessible
|
|
/// without authentication.
|
|
#[component]
|
|
pub fn PrivacyPage() -> Element {
|
|
let locale = use_context::<Signal<Locale>>();
|
|
let l = *locale.read();
|
|
|
|
rsx! {
|
|
div { class: "legal-page",
|
|
nav { class: "legal-nav",
|
|
Link { to: Route::LandingPage {}, class: "landing-logo",
|
|
span { class: "landing-logo-icon",
|
|
Icon { icon: BsShieldCheck, width: 20, height: 20 }
|
|
}
|
|
span { "CERTifAI" }
|
|
}
|
|
}
|
|
main { class: "legal-content",
|
|
h1 { "{t(l, \"privacy.title\")}" }
|
|
p { class: "legal-updated", "{t(l, \"privacy.last_updated\")}" }
|
|
|
|
h2 { "{t(l, \"privacy.intro_title\")}" }
|
|
p { "{t(l, \"privacy.intro_text\")}" }
|
|
|
|
h2 { "{t(l, \"privacy.controller_title\")}" }
|
|
p {
|
|
"{t(l, \"impressum.company\")}"
|
|
br {}
|
|
"{t(l, \"privacy.controller_address\")}"
|
|
br {}
|
|
"{t(l, \"privacy.controller_email\")}"
|
|
}
|
|
|
|
h2 { "{t(l, \"privacy.data_title\")}" }
|
|
p { "{t(l, \"privacy.data_intro\")}" }
|
|
ul {
|
|
li {
|
|
strong { "{t(l, \"privacy.data_account_label\")}" }
|
|
"{t(l, \"privacy.data_account_text\")}"
|
|
}
|
|
li {
|
|
strong { "{t(l, \"privacy.data_usage_label\")}" }
|
|
"{t(l, \"privacy.data_usage_text\")}"
|
|
}
|
|
li {
|
|
strong { "{t(l, \"privacy.data_technical_label\")}" }
|
|
"{t(l, \"privacy.data_technical_text\")}"
|
|
}
|
|
}
|
|
|
|
h2 { "{t(l, \"privacy.use_title\")}" }
|
|
ul {
|
|
li { "{t(l, \"privacy.use_1\")}" }
|
|
li { "{t(l, \"privacy.use_2\")}" }
|
|
li { "{t(l, \"privacy.use_3\")}" }
|
|
li { "{t(l, \"privacy.use_4\")}" }
|
|
}
|
|
|
|
h2 { "{t(l, \"privacy.storage_title\")}" }
|
|
p { "{t(l, \"privacy.storage_text\")}" }
|
|
|
|
h2 { "{t(l, \"privacy.rights_title\")}" }
|
|
p { "{t(l, \"privacy.rights_intro\")}" }
|
|
ul {
|
|
li { "{t(l, \"privacy.rights_access\")}" }
|
|
li { "{t(l, \"privacy.rights_rectify\")}" }
|
|
li { "{t(l, \"privacy.rights_erasure\")}" }
|
|
li { "{t(l, \"privacy.rights_restrict\")}" }
|
|
li { "{t(l, \"privacy.rights_portability\")}" }
|
|
li { "{t(l, \"privacy.rights_complaint\")}" }
|
|
}
|
|
|
|
h2 { "{t(l, \"privacy.contact_title\")}" }
|
|
p { "{t(l, \"privacy.contact_text\")}" }
|
|
}
|
|
footer { class: "legal-footer",
|
|
Link { to: Route::LandingPage {}, "{t(l, \"common.back_to_home\")}" }
|
|
Link { to: Route::ImpressumPage {}, "{t(l, \"common.impressum\")}" }
|
|
}
|
|
}
|
|
}
|
|
}
|