feat(i18n): add internationalization with DE, FR, ES, PT translations (#12)
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

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
This commit was merged in pull request #12.
This commit is contained in:
2026-02-22 16:48:51 +00:00
parent 50237f5377
commit d814e22f9d
43 changed files with 3015 additions and 383 deletions

View File

@@ -2,6 +2,7 @@ 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.
@@ -10,6 +11,9 @@ use crate::Route;
/// 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",
@@ -21,85 +25,66 @@ pub fn PrivacyPage() -> Element {
}
}
main { class: "legal-content",
h1 { "Privacy Policy" }
p { class: "legal-updated", "Last updated: February 2026" }
h1 { "{t(l, \"privacy.title\")}" }
p { class: "legal-updated", "{t(l, \"privacy.last_updated\")}" }
h2 { "1. Introduction" }
p {
"CERTifAI GmbH (\"we\", \"our\", \"us\") is committed to "
"protecting your personal data. This privacy policy explains "
"how we collect, use, and safeguard your information when you "
"use our platform."
}
h2 { "{t(l, \"privacy.intro_title\")}" }
p { "{t(l, \"privacy.intro_text\")}" }
h2 { "2. Data Controller" }
h2 { "{t(l, \"privacy.controller_title\")}" }
p {
"CERTifAI GmbH"
"{t(l, \"impressum.company\")}"
br {}
"Musterstrasse 1, 10115 Berlin, Germany"
"{t(l, \"privacy.controller_address\")}"
br {}
"Email: privacy@certifai.example"
"{t(l, \"privacy.controller_email\")}"
}
h2 { "3. Data We Collect" }
p {
"We collect only the minimum data necessary to provide "
"our services:"
}
h2 { "{t(l, \"privacy.data_title\")}" }
p { "{t(l, \"privacy.data_intro\")}" }
ul {
li {
strong { "Account data: " }
"Name, email address, and organization details "
"provided during registration."
strong { "{t(l, \"privacy.data_account_label\")}" }
"{t(l, \"privacy.data_account_text\")}"
}
li {
strong { "Usage data: " }
"API call logs, token counts, and feature usage "
"metrics for billing and analytics."
strong { "{t(l, \"privacy.data_usage_label\")}" }
"{t(l, \"privacy.data_usage_text\")}"
}
li {
strong { "Technical data: " }
"IP addresses, browser type, and session identifiers "
"for security and platform stability."
strong { "{t(l, \"privacy.data_technical_label\")}" }
"{t(l, \"privacy.data_technical_text\")}"
}
}
h2 { "4. How We Use Your Data" }
h2 { "{t(l, \"privacy.use_title\")}" }
ul {
li { "To provide and maintain the CERTifAI platform" }
li { "To manage your account and subscription" }
li { "To communicate service updates and security notices" }
li { "To comply with legal obligations" }
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 { "5. Data Storage and Sovereignty" }
p {
"CERTifAI is a self-hosted platform. All AI workloads, "
"model data, and inference results remain entirely within "
"your own infrastructure. We do not access, store, or "
"process your AI data on our servers."
}
h2 { "{t(l, \"privacy.storage_title\")}" }
p { "{t(l, \"privacy.storage_text\")}" }
h2 { "6. Your Rights (GDPR)" }
p { "Under the GDPR, you have the right to:" }
h2 { "{t(l, \"privacy.rights_title\")}" }
p { "{t(l, \"privacy.rights_intro\")}" }
ul {
li { "Access your personal data" }
li { "Rectify inaccurate data" }
li { "Request erasure of your data" }
li { "Restrict or object to processing" }
li { "Data portability" }
li { "Lodge a complaint with a supervisory authority" }
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 { "7. Contact" }
p {
"For privacy-related inquiries, contact us at "
"privacy@certifai.example."
}
h2 { "{t(l, \"privacy.contact_title\")}" }
p { "{t(l, \"privacy.contact_text\")}" }
}
footer { class: "legal-footer",
Link { to: Route::LandingPage {}, "Back to Home" }
Link { to: Route::ImpressumPage {}, "Impressum" }
Link { to: Route::LandingPage {}, "{t(l, \"common.back_to_home\")}" }
Link { to: Route::ImpressumPage {}, "{t(l, \"common.impressum\")}" }
}
}
}