Files
certifai/src/pages/impressum.rs
Sharang Parnerkar d814e22f9d
All checks were successful
CI / Format (push) Successful in 3s
CI / Clippy (push) Successful in 3m4s
CI / Security Audit (push) Successful in 1m39s
CI / Tests (push) Successful in 4m26s
CI / Deploy (push) Successful in 5s
feat(i18n): add internationalization with DE, FR, ES, PT translations (#12)
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
2026-02-22 16:48:51 +00:00

79 lines
2.6 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;
/// Impressum (legal notice) page required by German/EU law.
///
/// Displays placeholder company information. This page is publicly
/// accessible without authentication.
#[component]
pub fn ImpressumPage() -> 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, \"impressum.title\")}" }
h2 { "{t(l, \"impressum.info_tmg\")}" }
p {
"{t(l, \"impressum.company\")}"
br {}
"{t(l, \"impressum.address_street\")}"
br {}
"{t(l, \"impressum.address_city\")}"
br {}
"{t(l, \"impressum.address_country\")}"
}
h2 { "{t(l, \"impressum.represented_by\")}" }
p { "{t(l, \"impressum.managing_director\")}" }
h2 { "{t(l, \"impressum.contact\")}" }
p {
"{t(l, \"impressum.email\")}"
br {}
"{t(l, \"impressum.phone\")}"
}
h2 { "{t(l, \"impressum.commercial_register\")}" }
p {
"{t(l, \"impressum.registered_at\")}"
br {}
"{t(l, \"impressum.registration_number\")}"
}
h2 { "{t(l, \"impressum.vat_id\")}" }
p { "{t(l, \"impressum.vat_number\")}" }
h2 { "{t(l, \"impressum.responsible_content\")}" }
p {
"[Name]"
br {}
"{t(l, \"impressum.company\")}"
br {}
"{t(l, \"impressum.address_street\")}"
br {}
"{t(l, \"impressum.address_city\")}"
}
}
footer { class: "legal-footer",
Link { to: Route::LandingPage {}, "{t(l, \"common.back_to_home\")}" }
Link { to: Route::PrivacyPage {}, "{t(l, \"common.privacy_policy\")}" }
}
}
}
}