feat(i18n): Phase 1 — migrate 5 critical files from hardcoded text to i18n
All checks were successful
Deploy to Production / Build and Deploy (push) Successful in 2m51s

47 new i18n keys added across all 13 locales (en, fr, es, de, pt, it,
nl, ru, ja, ko, zh, ar, fa). English and French are fully translated,
remaining locales use French as placeholder.

Files migrated:
- EditGlossaryDialog.tsx (18 strings)
- DeleteGlossaryDialog.tsx (7 strings)
- ProUpgradePrompt.tsx (10 strings)
- WebhookSnippet.tsx (4 strings)
- TranslationModeToggle.tsx (8 strings)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-01 00:28:24 +02:00
parent c82e70681f
commit 6d27dc4cda
6 changed files with 666 additions and 47 deletions

View File

@@ -9,6 +9,7 @@ import {
TooltipTrigger,
} from '@/components/ui/tooltip';
import type { TranslationMode } from './types';
import { useI18n } from '@/lib/i18n';
interface TranslationModeToggleProps {
mode: TranslationMode;
@@ -21,11 +22,12 @@ export function TranslationModeToggle({
onModeChange,
isPro,
}: TranslationModeToggleProps) {
const { t } = useI18n();
return (
<TooltipProvider>
<div className="flex flex-col gap-1.5">
<label className="text-xs font-medium text-muted-foreground">
Translation Mode
{t('translate.mode.label')}
</label>
<div className="flex rounded-lg border border-border bg-muted p-1">
<button
@@ -38,9 +40,9 @@ export function TranslationModeToggle({
)}
onClick={() => onModeChange('classic')}
>
Classic
{t('translate.mode.classic')}
<span className="ms-1.5 text-xs text-muted-foreground">
Fast
{t('translate.mode.classicDesc')}
</span>
</button>
<Tooltip>
@@ -57,9 +59,9 @@ export function TranslationModeToggle({
onClick={() => isPro && onModeChange('llm')}
disabled={!isPro}
>
Pro LLM
{t('translate.mode.proLlm')}
<span className="ms-1.5 text-xs text-muted-foreground">
Context-Aware
{t('translate.mode.proLlmDesc')}
</span>
{!isPro && (
<Lock className="absolute right-2 top-1/2 -translate-y-1/2 size-3 text-muted-foreground" />
@@ -68,7 +70,7 @@ export function TranslationModeToggle({
</TooltipTrigger>
{!isPro && (
<TooltipContent side="top">
<p>Upgrade to Pro for LLM translation</p>
<p>{t('translate.mode.tooltip')}</p>
</TooltipContent>
)}
</Tooltip>
@@ -76,9 +78,9 @@ export function TranslationModeToggle({
{!isPro && (
<p className="text-xs text-muted-foreground">
<a href="/pricing" className="text-primary hover:underline">
Upgrade to Pro
{t('translate.mode.upgradeLink')}
</a>{' '}
for LLM-powered translations
{t('translate.mode.upgradeDesc')}
</p>
)}
</div>