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

@@ -10,6 +10,7 @@ import {
DialogTitle,
} from '@/components/ui/dialog';
import { Button } from '@/components/ui/button';
import { useI18n } from '@/lib/i18n';
interface DeleteGlossaryDialogProps {
open: boolean;
@@ -26,13 +27,14 @@ export function DeleteGlossaryDialog({
isDeleting,
glossaryName,
}: DeleteGlossaryDialogProps) {
const { t } = useI18n();
return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="sm:max-w-md">
<DialogHeader>
<DialogTitle>Delete Glossary</DialogTitle>
<DialogTitle>{t('glossaries.delete.title')}</DialogTitle>
<DialogDescription>
Are you sure you want to delete this glossary?
{t('glossaries.delete.description')}
{glossaryName && (
<span className="block mt-1 font-medium text-foreground">
"{glossaryName}"
@@ -45,9 +47,9 @@ export function DeleteGlossaryDialog({
<div className="flex items-start gap-3">
<AlertTriangle className="h-5 w-5 text-destructive shrink-0 mt-0.5" />
<div className="space-y-1">
<p className="text-sm font-medium text-destructive">This action cannot be undone</p>
<p className="text-sm font-medium text-destructive">{t('glossaries.delete.warning')}</p>
<p className="text-sm text-muted-foreground">
All term pairs will be permanently removed.
{t('glossaries.delete.warningDesc')}
</p>
</div>
</div>
@@ -59,14 +61,14 @@ export function DeleteGlossaryDialog({
onClick={() => onOpenChange(false)}
disabled={isDeleting}
>
Cancel
{t('glossaries.delete.cancel')}
</Button>
<Button
variant="destructive"
<Button
variant="destructive"
onClick={onConfirm}
disabled={isDeleting}
>
{isDeleting ? 'Deleting...' : 'Delete'}
{isDeleting ? t('glossaries.delete.deleting') : t('glossaries.delete.deleteBtn')}
</Button>
</DialogFooter>
</DialogContent>