i18n: fix missing keys and translate all non-admin frontend strings
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m43s

- Add 12 missing i18n keys (t() was returning the literal key string) to
  all 13 locales: dashboard.topbar.premiumAccess,
  dashboard.translate.complete.toastOkDesc,
  dashboard.translate.progress.{connectionLost,processingFallback},
  glossaries.card.{term,created}, glossaries.termEditor.{addTerm,maxReached},
  login.google.{connecting,errorFailed,errorGeneric}, login.orContinueWith
- Add 6 FR-drift keys (landing.pricing.{free,enterprise}.{name,desc,cta})
- Add ~120 new i18n keys covering site header/footer, file-uploader,
  checkout success, dashboard pages, translate page, provider selector
  themes, language selector, translation complete, api-keys, services,
  settings, pricing (~1800 new key/locale pairs)
- Wrap hardcoded French/English in components with t() calls
- Convert LLM_THEMES/CLASSIC_THEMES/FALLBACK_PROVIDERS maps from
  hardcoded constants to t()-driven factories
- Admin pages intentionally left untouched per request

Files: 15 components/pages + src/lib/i18n.tsx
Typecheck: passes (tsc --noEmit exit 0)
This commit is contained in:
2026-06-14 12:45:12 +02:00
parent 9b0b2ae6f9
commit eda6821632
16 changed files with 2188 additions and 191 deletions

View File

@@ -4,6 +4,7 @@ import { useEffect, useState } from 'react';
import { useRouter, useSearchParams } from 'next/navigation';
import { Loader2 } from 'lucide-react';
import { useUser } from './useUser';
import { useI18n } from '@/lib/i18n';
import { API_BASE } from '@/lib/config';
/**
@@ -18,6 +19,7 @@ export default function DashboardPage() {
const checkoutSessionId = searchParams.get('session_id');
const [syncError, setSyncError] = useState<string | null>(null);
const { refetch } = useUser();
const { t } = useI18n();
useEffect(() => {
if (!checkoutSessionId) {
@@ -42,20 +44,20 @@ export default function DashboardPage() {
if (!cancelled) {
if (!res.ok) {
const errData = await res.json().catch(() => ({}));
setSyncError(errData.message || 'Erreur lors de la synchronisation du paiement.');
setSyncError(errData.message || t('dashboard.checkoutSyncError'));
} else {
await refetch();
router.replace('/dashboard/translate');
}
}
} catch {
if (!cancelled) setSyncError('Erreur réseau. Veuillez rafraîchir la page.');
if (!cancelled) setSyncError(t('dashboard.networkRefresh'));
}
};
runSync();
return () => { cancelled = true; };
}, [checkoutSessionId, refetch, router]);
}, [checkoutSessionId, refetch, router, t]);
if (syncError) {
return (
@@ -65,7 +67,7 @@ export default function DashboardPage() {
onClick={() => router.replace('/dashboard/translate')}
className="text-xs text-muted-foreground underline"
>
Continuer vers la traduction
{t('dashboard.continueToTranslate')}
</button>
</div>
);