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
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:
@@ -32,6 +32,7 @@ function Combobox({
|
||||
placeholder: string;
|
||||
onChange: (code: string) => void;
|
||||
}) {
|
||||
const { t } = useI18n();
|
||||
const [open, setOpen] = useState(false);
|
||||
const [query, setQuery] = useState('');
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
@@ -81,13 +82,13 @@ function Combobox({
|
||||
type="text"
|
||||
value={query}
|
||||
onChange={e => setQuery(e.target.value)}
|
||||
placeholder="Search..."
|
||||
placeholder={t('langSelector.search')}
|
||||
className="w-full bg-transparent px-1 py-1 text-xs outline-none placeholder:text-brand-dark/30 dark:placeholder:text-white/30 text-brand-dark dark:text-white"
|
||||
/>
|
||||
</div>
|
||||
<div className="max-h-[160px] overflow-y-auto p-1 mt-1 space-y-0.5">
|
||||
{filtered.length === 0 && (
|
||||
<div className="px-3 py-3 text-center text-xs text-brand-dark/40 dark:text-white/40">No results</div>
|
||||
<div className="px-3 py-3 text-center text-xs text-brand-dark/40 dark:text-white/40">{t('langSelector.noResults')}</div>
|
||||
)}
|
||||
{filtered.map(lang => (
|
||||
<button
|
||||
@@ -143,7 +144,7 @@ export default function LanguageSelector({
|
||||
<div className="grid grid-cols-11 gap-2 items-center">
|
||||
{/* Source */}
|
||||
<div className="col-span-5 relative text-left">
|
||||
<span className="text-[10px] font-bold text-brand-dark/40 dark:text-white/40 uppercase tracking-widest block mb-1">Source</span>
|
||||
<span className="text-[10px] font-bold text-brand-dark/40 dark:text-white/40 uppercase tracking-widest block mb-1">{t('langSelector.source')}</span>
|
||||
<Combobox
|
||||
value={sourceLang}
|
||||
options={languages}
|
||||
@@ -166,7 +167,7 @@ export default function LanguageSelector({
|
||||
? 'text-brand-dark/50 dark:text-white/50 hover:text-brand-accent hover:bg-brand-muted/50 dark:hover:bg-white/5'
|
||||
: 'cursor-not-allowed opacity-30'
|
||||
)}
|
||||
title="Inverser"
|
||||
title={t('langSelector.swap')}
|
||||
>
|
||||
<ArrowRightLeft size={12} />
|
||||
</button>
|
||||
@@ -174,7 +175,7 @@ export default function LanguageSelector({
|
||||
|
||||
{/* Target */}
|
||||
<div className="col-span-5 relative text-left">
|
||||
<span className="text-[10px] font-bold text-brand-dark/40 dark:text-white/40 uppercase tracking-widest block mb-1">Cible</span>
|
||||
<span className="text-[10px] font-bold text-brand-dark/40 dark:text-white/40 uppercase tracking-widest block mb-1">{t('langSelector.target')}</span>
|
||||
<Combobox
|
||||
value={targetLang}
|
||||
options={languages}
|
||||
|
||||
Reference in New Issue
Block a user