From 0d68851b636c0299b057e274143fa5ae450a8847 Mon Sep 17 00:00:00 2001
From: Matthieu MALVACHE
Date: Thu, 8 Jan 2026 04:29:19 +0100
Subject: [PATCH] feat(i18n): Complete internationalization with timezone fixes
and language switching
Completes full internationalization coverage for the webmail application with enhanced language support:
- Replace all remaining hardcoded English strings with translation keys
- Add timezone auto-detection to prevent hydration mismatches
- Enable instant client-side language switching without page reload
- Add 60+ new translation keys in English and French locales
- Improve language switcher component with proper state management
- Add health check endpoint for container orchestration
All user-facing text now supports English and French with no hardcoded fallbacks, providing a fully localized experience.
---
app/[locale]/error.tsx | 5 +-
app/[locale]/layout.tsx | 8 +-
app/[locale]/login/page.tsx | 9 +-
app/[locale]/page.tsx | 97 ++++++---
app/[locale]/settings/page.tsx | 5 +-
app/api/health/route.ts | 126 ++++++++++++
components/email/email-composer.tsx | 24 +--
components/email/email-viewer.tsx | 213 +++++++++++++-------
components/layout/mobile-header.tsx | 4 +-
components/layout/sidebar.tsx | 38 +++-
components/providers/intl-provider.tsx | 63 ++++++
components/settings/appearance-settings.tsx | 6 +
components/ui/language-switcher.tsx | 58 +++---
i18n/navigation.ts | 4 +
i18n/request.ts | 13 +-
i18n/routing.ts | 11 +
locales/en/common.json | 64 +++++-
locales/fr/common.json | 64 +++++-
proxy.ts | 11 +-
stores/ui-store.ts | 7 +
20 files changed, 638 insertions(+), 192 deletions(-)
create mode 100644 app/api/health/route.ts
create mode 100644 components/providers/intl-provider.tsx
create mode 100644 i18n/navigation.ts
create mode 100644 i18n/routing.ts
diff --git a/app/[locale]/error.tsx b/app/[locale]/error.tsx
index b5c7ae6b..50706cff 100644
--- a/app/[locale]/error.tsx
+++ b/app/[locale]/error.tsx
@@ -4,7 +4,7 @@ import { useEffect } from "react";
import { useTranslations } from "next-intl";
import { AlertCircle, RefreshCw, Home } from "lucide-react";
import { Button } from "@/components/ui/button";
-import { useParams, useRouter } from "next/navigation";
+import { useRouter } from "@/i18n/navigation";
/**
* Route-level error boundary for locale pages.
@@ -18,7 +18,6 @@ export default function LocaleError({
reset: () => void;
}) {
const t = useTranslations("errors");
- const params = useParams();
const router = useRouter();
useEffect(() => {
@@ -38,7 +37,7 @@ export default function LocaleError({
{t("page_error_description")}
-