From 91b8a42fdd7a178a7862e1d12ec09e44c954de90 Mon Sep 17 00:00:00 2001 From: Matthieu MALVACHE Date: Thu, 8 Jan 2026 04:24:58 +0100 Subject: [PATCH] feat(i18n): Complete internationalization coverage Replaces all remaining hardcoded strings with translation keys to ensure full localization support across the application. This allows users to experience the entire interface in their preferred language without any English fallbacks. --- app/[locale]/page.tsx | 11 +++--- components/email/email-composer.tsx | 24 ++++++------ components/email/email-viewer.tsx | 59 ++++++++++++++++------------- components/layout/sidebar.tsx | 3 +- locales/en/common.json | 48 ++++++++++++++++++++++- locales/fr/common.json | 48 ++++++++++++++++++++++- 6 files changed, 144 insertions(+), 49 deletions(-) diff --git a/app/[locale]/page.tsx b/app/[locale]/page.tsx index 94e6caa..bf97c58 100644 --- a/app/[locale]/page.tsx +++ b/app/[locale]/page.tsx @@ -31,6 +31,7 @@ import { DragDropProvider } from "@/contexts/drag-drop-context"; export default function Home() { const router = useRouter(); const t = useTranslations(); + const tCommon = useTranslations('common'); const [showComposer, setShowComposer] = useState(false); const [composerMode, setComposerMode] = useState<'compose' | 'reply' | 'replyAll' | 'forward'>('compose'); const [initialCheckDone, setInitialCheckDone] = useState(false); @@ -194,7 +195,7 @@ export default function Home() { // Update page title based on context useEffect(() => { - let title = "Webmail"; + let title = tCommon('app_title'); if (showComposer) { // Composing email @@ -204,11 +205,11 @@ export default function Home() { replyAll: t('email_composer.reply_all'), forward: t('email_composer.forward'), }[composerMode] || t('email_composer.new_message'); - title = `${modeText} - Webmail`; + title = `${modeText} - ${tCommon('app_title')}`; } else if (selectedEmail) { // Reading email const subject = selectedEmail.subject || t('email_viewer.no_subject'); - title = `${subject} - Webmail`; + title = `${subject} - ${tCommon('app_title')}`; } else if (selectedMailbox && mailboxes.length > 0) { // Mailbox view const mailbox = mailboxes.find(mb => mb.id === selectedMailbox); @@ -216,8 +217,8 @@ export default function Home() { const mailboxName = mailbox.name; const unreadCount = mailbox.unreadEmails || 0; title = unreadCount > 0 - ? `${mailboxName} (${unreadCount}) - Webmail` - : `${mailboxName} - Webmail`; + ? `${mailboxName} (${unreadCount}) - ${tCommon('app_title')}` + : `${mailboxName} - ${tCommon('app_title')}`; } } diff --git a/components/email/email-composer.tsx b/components/email/email-composer.tsx index 6da53ab..0544520 100644 --- a/components/email/email-composer.tsx +++ b/components/email/email-composer.tsx @@ -315,19 +315,19 @@ export function EmailComposer({ {saveStatus === 'saving' && (
- Saving... + {t('saving')}
)} {saveStatus === 'saved' && (
- Draft saved + {t('draft_saved')}
)} {saveStatus === 'error' && (
- Failed to save + {t('save_failed')}
)} @@ -366,7 +366,7 @@ export function EmailComposer({ {t('to')}: setTo(e.target.value)} className="flex-1 border-0 focus-visible:ring-0" @@ -393,10 +393,10 @@ export function EmailComposer({ {showCc && (
- Cc: + {t('cc_label')} setCc(e.target.value)} className="flex-1 border-0 focus-visible:ring-0" @@ -406,10 +406,10 @@ export function EmailComposer({ {showBcc && (
- Bcc: + {t('bcc_label')} setBcc(e.target.value)} className="flex-1 border-0 focus-visible:ring-0" @@ -418,10 +418,10 @@ export function EmailComposer({ )}
- Subject: + {t('subject_label')} setSubject(e.target.value)} className="flex-1 border-0 focus-visible:ring-0" @@ -432,7 +432,7 @@ export function EmailComposer({