feat: add i18n support with VITE_LOCALE env var (en/fr)

- Lightweight i18n system in src/lib/i18n.ts (no external deps)
- All UI strings extracted to translation keys
- English (default) and French locales included
- Set VITE_LOCALE=fr in .env for French UI
- Fallback to English for unknown locales
This commit is contained in:
Nicolas Varrot
2026-02-11 13:19:20 +00:00
parent 8132ddb59f
commit 99b7db9793
9 changed files with 134 additions and 31 deletions

View File

@@ -1,5 +1,6 @@
import { useState } from 'react';
import { ChevronRight, ChevronDown, Brain } from 'lucide-react';
import { t } from '../lib/i18n';
export function ThinkingBlock({ text }: { text: string }) {
const [open, setOpen] = useState(false);
@@ -11,7 +12,7 @@ export function ThinkingBlock({ text }: { text: string }) {
className="inline-flex items-center gap-1.5 rounded-2xl border border-white/8 bg-zinc-800/35 px-3 py-1.5 text-xs text-violet-300 hover:bg-white/5 transition-colors"
>
<Brain size={13} />
<span className="font-medium">Thinking</span>
<span className="font-medium">{t('thinking.label')}</span>
{open ? <ChevronDown size={12} className="ml-1 text-zinc-500" /> : <ChevronRight size={12} className="ml-1 text-zinc-500" />}
</button>
{open && (