Skip to content

armgit / mimik

Public Imported from GitHub
0

🎬 A browser extension and desktop app that turns your clicks into step-by-step guides with annotated screenshots πŸ“–

feat(i18n): wire i18n.t() into all UI components, step descriptions, and exports

Luis Ortiz653f42431b91
diff --git a/src/core/blur/element-picker.ts b/src/core/blur/element-picker.ts
index d57a18a..2abc102 100644
--- a/src/core/blur/element-picker.ts
+++ b/src/core/blur/element-picker.ts
@@ -1,3 +1,5 @@
+import { i18n } from '#imports';
+
const MANUAL_CLASS = 'mimik-manual-blur';
const BLUR_ATTR = 'data-mimik-blur';
@@ -107,12 +109,12 @@ export class ElementPicker {
bar.innerHTML = `
<div class="bar-left">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M3 3l7.07 16.97 2.51-7.39 7.39-2.51L3 3z"/></svg>
- Select elements to blur
+ ${i18n.t('blurPanel.selectElements')}
</div>
`;
const doneBtn = document.createElement('button');
doneBtn.className = 'bar-done';
- doneBtn.textContent = 'Done';
+ doneBtn.textContent = i18n.t('blurPanel.done');
doneBtn.addEventListener('click', () => this.onDone?.());
bar.appendChild(doneBtn);
shadow.appendChild(bar);
diff --git a/src/core/blur/panel.ts b/src/core/blur/panel.ts
index 85cf01a..ff718f2 100644
--- a/src/core/blur/panel.ts
+++ b/src/core/blur/panel.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import type { PresetKey } from './regexes';
import { PRESET_LABELS } from './regexes';
@@ -304,7 +305,7 @@ export class BlurPanel {
const title = document.createElement('div');
title.className = 'header-title';
- title.innerHTML = `${icon('blur')} Smart Blur`;
+ title.innerHTML = `${icon('blur')} ${i18n.t('blurPanel.title')}`;
header.appendChild(title);
const closeBtn = document.createElement('button');
@@ -327,7 +328,7 @@ export class BlurPanel {
const label = document.createElement('span');
label.className = 'section-label';
- label.textContent = 'Manual Mode';
+ label.textContent = i18n.t('blurPanel.manualMode');
row.appendChild(label);
const anyOn = PRESET_KEYS.some((k) => this.presets[k]);
@@ -400,7 +401,7 @@ export class BlurPanel {
private buildResetButton(): HTMLElement {
const btn = document.createElement('button');
btn.className = 'btn-reset';
- btn.textContent = 'Reset All';
+ btn.textContent = i18n.t('blurPanel.resetAll');
btn.addEventListener('click', () => {
document.dispatchEvent(new CustomEvent('mimik-blur:reset'));
});
@@ -413,7 +414,7 @@ export class BlurPanel {
const btn = document.createElement('button');
btn.className = 'btn-done';
- btn.textContent = 'Done \u00B7 Resume Recording';
+ btn.textContent = i18n.t('blurPanel.doneResume');
btn.addEventListener('click', () => {
document.dispatchEvent(new CustomEvent('mimik-blur:done'));
});
diff --git a/src/core/capture/step-description.ts b/src/core/capture/step-description.ts
index c0c8766..6eb8173 100644
--- a/src/core/capture/step-description.ts
+++ b/src/core/capture/step-description.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import type { ElementMeta } from '@/core/guides/types';
export function buildFallbackDescription(action: string, meta: ElementMeta): string {
@@ -12,32 +13,33 @@ export function buildFallbackDescription(action: string, meta: ElementMeta): str
if (action.startsWith('keydown:')) {
const key = action.split(':')[1];
- return `Press ${key} on ${target}`;
+ return i18n.t('steps.pressKey', [key, target]);
}
switch (action) {
case 'click':
case 'auxclick':
- if (meta.tag === 'input' && meta.inputType === 'checkbox') return `Toggle ${target}`;
- if (meta.tag === 'input' && meta.inputType === 'radio') return `Select ${target}`;
- if (meta.role === 'switch' || meta.role === 'checkbox') return `Toggle ${target}`;
- if (meta.role === 'radio') return `Select ${target}`;
- if (meta.href) return `Click link "${target}"`;
- return `Click ${target}`;
+ if (meta.tag === 'input' && meta.inputType === 'checkbox') return i18n.t('steps.toggleCheckbox', [target]);
+ if (meta.tag === 'input' && meta.inputType === 'radio') return i18n.t('steps.selectRadio', [target]);
+ if (meta.role === 'switch') return i18n.t('steps.toggleSwitch', [target]);
+ if (meta.role === 'checkbox') return i18n.t('steps.toggleCheckbox', [target]);
+ if (meta.role === 'radio') return i18n.t('steps.selectRadio', [target]);
+ if (meta.href) return i18n.t('steps.clickLink', [target]);
+ return i18n.t('steps.click', [target]);
case 'input':
- if (meta.inputType) return `Type into ${meta.inputType} field ${target}`;
- return `Type into ${target}`;
+ if (meta.inputType) return i18n.t('steps.typeIntoField', [meta.inputType, target]);
+ return i18n.t('steps.typeInto', [target]);
case 'copy':
- return `Copy from ${target}`;
+ return i18n.t('steps.copyFrom', [target]);
case 'paste':
- return `Paste into ${target}`;
+ return i18n.t('steps.pasteInto', [target]);
case 'cut':
- return `Cut from ${target}`;
+ return i18n.t('steps.cutFrom', [target]);
case 'drag':
- return `Drag ${target}`;
+ return i18n.t('steps.drag', [target]);
case 'navigate':
- return 'Navigate to page';
+ return i18n.t('steps.navigate');
default:
- return `${action} ${target}`;
+ return i18n.t('steps.defaultAction', [action, target]);
}
}
diff --git a/src/core/export/html-export.ts b/src/core/export/html-export.ts
index 53d287d..1779a9d 100644
--- a/src/core/export/html-export.ts
+++ b/src/core/export/html-export.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import { blobToBase64, escapeHtml, extractDomain, fetchFaviconBase64, formatDate } from '@/core/export/utils';
import type { Guide, Screenshot, Step } from '@/core/guides/types';
@@ -13,7 +14,7 @@ export async function exportGuideAsHTML(
let imgHtml = '';
if (screenshot) {
const b64 = await blobToBase64(screenshot.blob);
- imgHtml = `<img src="data:${screenshot.mimeType};base64,${b64}" alt="Step ${step.index + 1}" style="max-width:100%;border-radius:8px;box-shadow:0 1px 4px rgba(30,27,75,0.06);margin-top:16px;" />`;
+ imgHtml = `<img src="data:${screenshot.mimeType};base64,${b64}" alt="${i18n.t('export.stepLabel', [String(step.index + 1)])}" style="max-width:100%;border-radius:8px;box-shadow:0 1px 4px rgba(30,27,75,0.06);margin-top:16px;" />`;
}
const stepNumber = String(step.index + 1).padStart(2, '0');
@@ -49,18 +50,18 @@ export async function exportGuideAsHTML(
</head>
<body>
<div style="margin-bottom:48px;text-align:center;display:flex;flex-direction:column;align-items:center;">
- <span style="display:inline-block;background:#EEF2FF;color:#4F46E5;font-size:13px;font-weight:600;padding:5px 16px;border-radius:999px;">${steps.length} Step${steps.length === 1 ? '' : 's'}</span>
+ <span style="display:inline-block;background:#EEF2FF;color:#4F46E5;font-size:13px;font-weight:600;padding:5px 16px;border-radius:999px;">${i18n.t('export.stepsCount', [String(steps.length)])}</span>
<div style="height:3px;width:60%;background:linear-gradient(to right,#4F46E5,#C7D2FE,#818CF8);border-radius:3px;margin:20px auto;"></div>
<h1 style="font-size:28px;font-weight:800;color:#1E1B4B;line-height:1.2;margin-bottom:24px;max-width:80%;">${escapeHtml(guide.title)}</h1>
<div style="display:flex;gap:32px;justify-content:center;">
<div style="text-align:left;">
- <div style="font-size:10px;font-weight:600;color:#6B7280;text-transform:uppercase;letter-spacing:0.06em;">Created</div>
+ <div style="font-size:10px;font-weight:600;color:#6B7280;text-transform:uppercase;letter-spacing:0.06em;">${i18n.t('export.created')}</div>
<div style="font-size:14px;font-weight:600;color:#1E1B4B;">${formatDate(guide.createdAt)}</div>
</div>
${
domain
? `<div style="text-align:left;">
- <div style="font-size:10px;font-weight:600;color:#6B7280;text-transform:uppercase;letter-spacing:0.06em;">Source</div>
+ <div style="font-size:10px;font-weight:600;color:#6B7280;text-transform:uppercase;letter-spacing:0.06em;">${i18n.t('export.source')}</div>
<a href="https://${escapeHtml(domain)}" target="_blank" rel="noopener" style="font-size:14px;font-weight:600;color:#4F46E5;display:flex;align-items:center;gap:6px;text-decoration:none;">${favicon ? `<img src="${favicon}" width="18" height="18" style="border-radius:4px;" />` : ''}${escapeHtml(domain)}</a>
</div>`
: ''
diff --git a/src/core/export/markdown-export.ts b/src/core/export/markdown-export.ts
index 1d42b0c..7f8f4ca 100644
--- a/src/core/export/markdown-export.ts
+++ b/src/core/export/markdown-export.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import { blobToBase64, extractDomain, formatDate } from '@/core/export/utils';
import type { Guide, Screenshot, Step } from '@/core/guides/types';
@@ -8,21 +9,21 @@ export async function exportGuideAsMarkdown(
): Promise<string> {
const domain = extractDomain(steps);
const meta = [
- `${steps.length} steps`,
- `Created ${formatDate(guide.createdAt)}`,
- ...(domain ? [`Source: ${domain}`] : []),
+ i18n.t('export.stepsCount', [String(steps.length)]),
+ i18n.t('export.createdLabel', [formatDate(guide.createdAt)]),
+ ...(domain ? [i18n.t('export.sourceLabel', [domain])] : []),
].join(' Β· ');
const lines: string[] = [`# ${guide.title}`, '', `*${meta}*`, '', '---', ''];
for (const step of steps) {
const num = String(step.index + 1).padStart(2, '0');
- lines.push(`## Step ${num}: ${step.description}`, '');
+ lines.push(`## ${i18n.t('export.stepLabel', [num])}: ${step.description}`, '');
const screenshot = screenshots.get(step.id);
if (screenshot) {
const b64 = await blobToBase64(screenshot.blob);
- lines.push(`![Step ${num}](data:${screenshot.mimeType};base64,${b64})`, '');
+ lines.push(`![${i18n.t('export.stepLabel', [num])}](data:${screenshot.mimeType};base64,${b64})`, '');
}
}
diff --git a/src/core/export/pdf-export.ts b/src/core/export/pdf-export.ts
index fa1a9b9..1e24354 100644
--- a/src/core/export/pdf-export.ts
+++ b/src/core/export/pdf-export.ts
@@ -1,4 +1,5 @@
import { jsPDF } from 'jspdf';
+import { i18n } from '#imports';
import { blobToDataUrl, extractDomain, fetchFaviconBase64, formatDate } from '@/core/export/utils';
import type { Guide, Screenshot, Step } from '@/core/guides/types';
import { logger } from '@/lib/logger';
@@ -19,7 +20,7 @@ export async function exportGuideAsPDF(
const dateStr = formatDate(guide.createdAt);
const faviconDataUrl = domain ? await fetchFaviconBase64(domain) : null;
- const badgeText = `${steps.length} Steps`;
+ const badgeText = i18n.t('export.stepsCount', [String(steps.length)]);
doc.setFontSize(10);
doc.setFont('helvetica', 'bold');
const badgeTextWidth = doc.getTextWidth(badgeText);
@@ -77,7 +78,7 @@ export async function exportGuideAsPDF(
doc.setFontSize(7);
doc.setFont('helvetica', 'bold');
doc.setTextColor(107, 114, 128);
- doc.text('CREATED', metaX, y);
+ doc.text(i18n.t('export.created').toUpperCase(), metaX, y);
doc.setFontSize(12);
doc.setFont('helvetica', 'normal');
doc.setTextColor(30, 27, 75);
@@ -88,7 +89,7 @@ export async function exportGuideAsPDF(
doc.setFontSize(7);
doc.setFont('helvetica', 'bold');
doc.setTextColor(107, 114, 128);
- doc.text('SOURCE', metaX, y);
+ doc.text(i18n.t('export.source').toUpperCase(), metaX, y);
const faviconSize = 4;
let domainTextX = metaX;
if (faviconDataUrl) {
diff --git a/src/core/export/utils.ts b/src/core/export/utils.ts
index d20bec3..465464e 100644
--- a/src/core/export/utils.ts
+++ b/src/core/export/utils.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import type { Step } from '@/core/guides/types';
export function blobToBase64(blob: Blob): Promise<string> {
@@ -31,8 +32,15 @@ export function extractDomain(steps: Step[]): string | null {
}
}
+const LOCALE_MAP: Record<string, string> = { en: 'en-US', es: 'es', 'pt-BR': 'pt-BR', fr: 'fr' };
+
export function formatDate(timestamp: number): string {
- return new Date(timestamp).toLocaleDateString('en-US', {
+ let locale = 'en-US';
+ try {
+ const meta = i18n.t('meta.locale');
+ if (meta && LOCALE_MAP[meta]) locale = LOCALE_MAP[meta];
+ } catch {}
+ return new Date(timestamp).toLocaleDateString(locale, {
month: 'short',
day: '2-digit',
year: 'numeric',
diff --git a/src/core/guides/service.ts b/src/core/guides/service.ts
index 7bb9c5b..dfc919b 100644
--- a/src/core/guides/service.ts
+++ b/src/core/guides/service.ts
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import { db } from './db';
import type { Guide, Screenshot, Step } from './types';
@@ -18,7 +19,7 @@ function notifyGuidesChanged(event: GuideChangeEvent) {
export async function createGuide(guideId: string): Promise<Guide> {
const guide: Guide = {
id: guideId,
- title: 'Untitled Guide',
+ title: i18n.t('fullview.untitledGuide'),
createdAt: Date.now(),
updatedAt: Date.now(),
stepIds: [],
diff --git a/src/entrypoints/background/index.ts b/src/entrypoints/background/index.ts
index 5ab6fae..7fdcacd 100644
--- a/src/entrypoints/background/index.ts
+++ b/src/entrypoints/background/index.ts
@@ -1,4 +1,4 @@
-import { browser, defineBackground } from '#imports';
+import { browser, defineBackground, i18n } from '#imports';
import { generateGuideTitle } from '@/core/capture/ai/title';
import { advanceSession, cancelSession, completeSession, getSession, startSession } from '@/core/guideme/session';
import { createGuide, getGuideDomain, getStepsForGuide, updateGuideTitle } from '@/core/guides/service';
@@ -16,7 +16,10 @@ async function generateTitleInBackground(guideId: string) {
const settings = await localStorage.get(['aiApiKey', 'aiProvider', 'aiModel']);
if (!settings.aiApiKey) {
const domain = await getGuideDomain(guideId);
- await updateGuideTitle(guideId, domain ? `Guide on ${domain}` : 'New Guide');
+ await updateGuideTitle(
+ guideId,
+ domain ? i18n.t('background.guideOnDomain', [domain]) : i18n.t('background.newGuide'),
+ );
return;
}
@@ -33,12 +36,18 @@ async function generateTitleInBackground(guideId: string) {
logger.info('Generated guide title:', title);
} else {
const domain = await getGuideDomain(guideId);
- await updateGuideTitle(guideId, domain ? `Guide on ${domain}` : 'New Guide');
+ await updateGuideTitle(
+ guideId,
+ domain ? i18n.t('background.guideOnDomain', [domain]) : i18n.t('background.newGuide'),
+ );
}
} catch (err) {
logger.error('Guide title generation failed', err);
const domain = await getGuideDomain(guideId);
- await updateGuideTitle(guideId, domain ? `Guide on ${domain}` : 'New Guide');
+ await updateGuideTitle(
+ guideId,
+ domain ? i18n.t('background.guideOnDomain', [domain]) : i18n.t('background.newGuide'),
+ );
}
}
diff --git a/src/ui/fullview/GuideContent.tsx b/src/ui/fullview/GuideContent.tsx
index 510f873..414df02 100644
--- a/src/ui/fullview/GuideContent.tsx
+++ b/src/ui/fullview/GuideContent.tsx
@@ -1,6 +1,7 @@
import { Play } from 'lucide-react';
import { useCallback, useEffect, useRef, useState } from 'react';
import { TypeAnimation } from 'react-type-animation';
+import { i18n } from '#imports';
import {
deleteStep,
getGuide,
@@ -11,7 +12,7 @@ import {
} from '@/core/guides/service';
import type { Guide, Screenshot, Step } from '@/core/guides/types';
import { sendMessage } from '@/lib/messaging';
-import { getMostCommonDomain } from '@/lib/utils';
+import { formatDate, getMostCommonDomain } from '@/lib/utils';
import { useFullview } from '@/stores/fullview';
import FaviconImg from '@/ui/shared/FaviconImg';
import BlurCanvas from '@/ui/sidepanel/BlurCanvas';
@@ -47,13 +48,17 @@ export default function GuideContent({ guideId }: GuideContentProps) {
setData(result);
const newTitle = result.guide.title;
const prev = titleRef.current;
- if (prev === 'Untitled Guide' && newTitle !== 'Untitled Guide' && result.steps.length > 0) {
+ if (
+ prev === i18n.t('fullview_untitledGuide') &&
+ newTitle !== i18n.t('fullview_untitledGuide') &&
+ result.steps.length > 0
+ ) {
setTypingTitle(newTitle);
} else {
titleRef.current = newTitle;
setTitle(newTitle);
}
- document.title = `${newTitle} β€” Mimik`;
+ document.title = `${newTitle} β€” ${i18n.t('app_name')}`;
setGuideTitle(newTitle);
setGuideStepCount(result.steps.length);
setGuideExportData({ guideId, ...result });
@@ -70,7 +75,7 @@ export default function GuideContent({ guideId }: GuideContentProps) {
if (!data || title === data.guide.title) return;
await updateGuideTitle(guideId, title);
setData((prev) => (prev ? { ...prev, guide: { ...prev.guide, title } } : prev));
- document.title = `${title} β€” Mimik`;
+ document.title = `${title} β€” ${i18n.t('app_name')}`;
}, [data, guideId, title]);
const handleDescriptionChange = useCallback(async (stepId: string, description: string) => {
@@ -127,7 +132,7 @@ export default function GuideContent({ guideId }: GuideContentProps) {
</div>
</div>
);
- if (!data) return <p className="text-sm py-12 text-center text-purple">Guide not found.</p>;
+ if (!data) return <p className="text-sm py-12 text-center text-purple">{i18n.t('fullview_guideNotFound')}</p>;
const domain = getMostCommonDomain(data.steps);
const blurScreenshot = blurringStepId ? data.screenshots.get(blurringStepId) : undefined;
@@ -138,10 +143,14 @@ export default function GuideContent({ guideId }: GuideContentProps) {
<BlurCanvas screenshot={blurScreenshot} onSave={handleBlurSave} onCancel={() => setBlurringStepId(null)} />
)}
- <div className={title === 'Untitled Guide' && !typingTitle && data.steps.length > 0 ? 'min-h-[88px]' : ''}>
- {title === 'Untitled Guide' && !typingTitle && data.steps.length > 0 ? (
+ <div
+ className={
+ title === i18n.t('fullview_untitledGuide') && !typingTitle && data.steps.length > 0 ? 'min-h-[88px]' : ''
+ }
+ >
+ {title === i18n.t('fullview_untitledGuide') && !typingTitle && data.steps.length > 0 ? (
<div className="text-[32px] font-extrabold leading-tight animate-gradient-text bg-[length:300%_100%] bg-clip-text text-transparent bg-gradient-to-r from-muted-foreground via-violet to-muted-foreground max-w-[480px]">
- Writing a title from your captured steps...
+ {i18n.t('fullview_writingTitle')}
</div>
) : typingTitle ? (
<div className="relative text-[32px] font-extrabold leading-tight">
@@ -189,14 +198,12 @@ export default function GuideContent({ guideId }: GuideContentProps) {
<div className="flex items-center gap-1.5 mt-2 mb-4 flex-wrap">
<span className="inline-flex items-center text-[11px] font-medium text-muted-foreground bg-card border border-border px-2.5 py-0.5 rounded-full">
- {new Date(data.guide.createdAt).toLocaleDateString('en-US', {
- month: 'short',
- day: 'numeric',
- year: 'numeric',
- })}
+ {formatDate(data.guide.createdAt)}
</span>
<span className="inline-flex items-center text-[11px] font-medium text-muted-foreground bg-card border border-border px-2.5 py-0.5 rounded-full">
- {data.steps.length} step{data.steps.length !== 1 ? 's' : ''}
+ {data.steps.length !== 1
+ ? i18n.t('fullview_stepCountPlural', [String(data.steps.length)])
+ : i18n.t('fullview_stepCount', [String(data.steps.length)])}
</span>
{domain && (
<span className="inline-flex items-center gap-1.5 text-[11px] font-medium text-muted-foreground bg-card border border-border pl-1.5 pr-2.5 py-0.5 rounded-full">
@@ -214,7 +221,7 @@ export default function GuideContent({ guideId }: GuideContentProps) {
className="inline-flex items-center gap-1.5 text-[11px] font-semibold text-primary-foreground bg-primary hover:bg-primary/90 px-3 py-0.5 rounded-full transition-colors disabled:opacity-30 disabled:cursor-not-allowed ml-auto"
>
<Play size={11} />
- Guide Me
+ {i18n.t('fullview_guideMe')}
</button>
)}
</div>
diff --git a/src/ui/fullview/LibraryContent.tsx b/src/ui/fullview/LibraryContent.tsx
index 36e1224..ae97fb2 100644
--- a/src/ui/fullview/LibraryContent.tsx
+++ b/src/ui/fullview/LibraryContent.tsx
@@ -1,5 +1,6 @@
import { ArrowDownWideNarrow, ChevronDown, ChevronLeft, ChevronRight, LayoutGrid, LayoutList } from 'lucide-react';
import { useCallback, useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import {
type GuideChangeEvent,
getFirstScreenshot,
@@ -22,10 +23,10 @@ interface LibraryContentProps {
category: 'all' | 'starred' | 'trash';
}
-const emptyConfig: Record<string, { title: string; sub: string }> = {
- all: { title: 'No guides yet', sub: 'Start a capture to create your first guide' },
- starred: { title: 'No starred guides', sub: 'Star a guide to find it quickly' },
- trash: { title: 'Trash is empty', sub: 'Squeaky clean!' },
+const emptyConfig: Record<string, { titleKey: string; subKey: string }> = {
+ all: { titleKey: 'library_noGuidesTitle', subKey: 'library_noGuidesSub' },
+ starred: { titleKey: 'library_noStarredTitle', subKey: 'library_noStarredSub' },
+ trash: { titleKey: 'library_trashEmptyTitle', subKey: 'library_trashEmptySub' },
};
function EmptyMascot({ category }: { category: string }) {
@@ -116,11 +117,11 @@ function TrashMascot() {
}
type SortKey = 'recent' | 'oldest' | 'alpha' | 'steps';
-const sortLabels: Record<SortKey, string> = {
- recent: 'Recent first',
- oldest: 'Oldest first',
- alpha: 'A β€” Z',
- steps: 'Most steps',
+const sortLabelKeys: Record<SortKey, string> = {
+ recent: 'sort_recentFirst',
+ oldest: 'sort_oldestFirst',
+ alpha: 'sort_alphaAZ',
+ steps: 'sort_mostSteps',
};
const PAGE_SIZE = 9;
@@ -292,12 +293,12 @@ export default function LibraryContent({ category }: LibraryContentProps) {
className="flex items-center gap-1.5 text-xs font-medium text-muted-foreground px-3 py-1.5 rounded-lg border border-border bg-card hover:border-violet hover:text-purple transition-colors"
>
<ArrowDownWideNarrow size={13} />
- {sortLabels[sort]}
+ {i18n.t(sortLabelKeys[sort] as any)}
<ChevronDown size={10} className="ml-0.5" />
</button>
{sortOpen && (
<div className="absolute right-0 top-full mt-1 bg-card border border-border rounded-lg shadow-lg py-1 z-10 min-w-[140px]">
- {(Object.keys(sortLabels) as SortKey[]).map((key) => (
+ {(Object.keys(sortLabelKeys) as SortKey[]).map((key) => (
<button
key={key}
onClick={() => handleSort(key)}
@@ -307,7 +308,7 @@ export default function LibraryContent({ category }: LibraryContentProps) {
: 'text-muted-foreground hover:bg-secondary/50 hover:text-foreground'
}`}
>
- {sortLabels[key]}
+ {i18n.t(sortLabelKeys[key] as any)}
</button>
))}
</div>
@@ -316,19 +317,19 @@ export default function LibraryContent({ category }: LibraryContentProps) {
<button
onClick={toggleDisplay}
className="flex items-center justify-center w-8 h-8 rounded-lg border border-border bg-card text-muted-foreground hover:border-violet hover:text-purple transition-colors"
- title={display === 'list' ? 'Grid view' : 'List view'}
+ title={display === 'list' ? i18n.t('sort_gridView') : i18n.t('sort_listView')}
>
{display === 'list' ? <LayoutGrid size={15} /> : <LayoutList size={15} />}
</button>
</div>
{loading ? (
- <p className="text-sm py-12 text-center text-purple">Loading...</p>
+ <p className="text-sm py-12 text-center text-purple">{i18n.t('common_loading')}</p>
) : allGuidesRef.current.length === 0 ? (
<div className="text-center py-20 flex flex-col items-center">
<EmptyMascot category={category} />
- <p className="text-lg font-medium text-foreground mt-4">{emptyConfig[category].title}</p>
- <p className="text-sm text-muted-foreground mt-1">{emptyConfig[category].sub}</p>
+ <p className="text-lg font-medium text-foreground mt-4">{i18n.t(emptyConfig[category].titleKey as any)}</p>
+ <p className="text-sm text-muted-foreground mt-1">{i18n.t(emptyConfig[category].subKey as any)}</p>
</div>
) : display === 'list' ? (
<GuideListView
@@ -358,7 +359,7 @@ export default function LibraryContent({ category }: LibraryContentProps) {
<ChevronLeft size={15} />
</button>
<span className="text-xs font-medium text-muted-foreground">
- {page + 1} / {totalPages}
+ {i18n.t('fullview_pageOf', [String(page + 1), String(totalPages)])}
</span>
<button
onClick={() => applyPage(page + 1)}
diff --git a/src/ui/fullview/SearchModal.tsx b/src/ui/fullview/SearchModal.tsx
index d8c15a9..d41743b 100644
--- a/src/ui/fullview/SearchModal.tsx
+++ b/src/ui/fullview/SearchModal.tsx
@@ -1,5 +1,6 @@
import { Search, X } from 'lucide-react';
import { useCallback, useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import { getGuideDomain, getGuides } from '@/core/guides/service';
import type { Guide } from '@/core/guides/types';
@@ -88,7 +89,7 @@ export default function SearchModal() {
<Search size={18} className="text-accent shrink-0" />
<Input
ref={inputRef}
- placeholder="Search guides..."
+ placeholder={i18n.t('fullview_searchPlaceholder')}
value={query}
onChange={(e) => {
setQuery(e.target.value);
@@ -125,7 +126,7 @@ export default function SearchModal() {
<circle cx="38" cy="24" r="3" fill="#C7D2FE" />
<circle cx="39" cy="23.5" r="1" fill="#1E1B4B" />
</svg>
- <span className="text-[13px] font-medium text-muted-foreground/50">Start typing to find a guide</span>
+ <span className="text-[13px] font-medium text-muted-foreground/50">{i18n.t('search_startTyping')}</span>
</div>
)}
<KeyboardHints />
diff --git a/src/ui/fullview/TopNav.tsx b/src/ui/fullview/TopNav.tsx
index 002fd5d..64e7978 100644
--- a/src/ui/fullview/TopNav.tsx
+++ b/src/ui/fullview/TopNav.tsx
@@ -1,4 +1,5 @@
import { ChevronRight, FileText, Search, Star, Trash2 } from 'lucide-react';
+import { i18n } from '#imports';
import { useFullview } from '@/stores/fullview';
import { Button } from '@/ui/components/ui/button';
import ExportMenu from '@/ui/sidepanel/ExportMenu';
@@ -11,9 +12,9 @@ interface TopNavProps {
}
const navItems = [
- { key: 'all' as const, label: 'All Guides', icon: FileText },
- { key: 'starred' as const, label: 'Starred', icon: Star },
- { key: 'trash' as const, label: 'Trash', icon: Trash2 },
+ { key: 'all' as const, labelKey: 'fullview_allGuides' as const, icon: FileText },
+ { key: 'starred' as const, labelKey: 'fullview_starred' as const, icon: Star },
+ { key: 'trash' as const, labelKey: 'fullview_trash' as const, icon: Trash2 },
];
export default function TopNav({ route }: TopNavProps) {
@@ -41,14 +42,14 @@ export default function TopNav({ route }: TopNavProps) {
<div className="mb-1">
<MascotIcon size={22} />
</div>
- <span className="text-[15px] font-bold tracking-tight text-foreground">Mimik</span>
+ <span className="text-[15px] font-bold tracking-tight text-foreground">{i18n.t('app_name')}</span>
</button>
{route.page === 'guide'
? guideTitle && (
<>
<ChevronRight size={14} className="text-foreground opacity-25" />
- {guideTitle === 'Untitled Guide' && guideStepCount > 0 ? (
+ {guideTitle === i18n.t('fullview_untitledGuide') && guideStepCount > 0 ? (
<span className="flex items-center gap-1">
{[0, 1, 2].map((i) => (
<span
@@ -74,7 +75,7 @@ export default function TopNav({ route }: TopNavProps) {
${active ? 'bg-primary text-primary-foreground font-semibold' : 'text-deep font-medium hover:bg-foreground/10'}`}
>
<item.icon size={13.5} />
- {item.label}
+ {i18n.t(item.labelKey)}
{count > 0 && (
<span className={`text-[11px] ml-0.5 ${active ? 'text-primary-foreground/70' : 'text-violet-dark'}`}>
{count}
@@ -92,7 +93,7 @@ export default function TopNav({ route }: TopNavProps) {
className="flex items-center gap-2 px-3 h-8 rounded-lg w-52 cursor-pointer bg-white/40 border-0 hover:bg-white/60"
>
<Search size={14} className="shrink-0 text-violet-dark" />
- <span className="text-[12px] flex-1 text-left text-violet-dark">Search guides...</span>
+ <span className="text-[12px] flex-1 text-left text-violet-dark">{i18n.t('fullview_searchPlaceholder')}</span>
<span className="text-[9px] font-semibold px-1.5 py-0.5 rounded bg-foreground/10 text-violet-dark">⌘K</span>
</Button>
{route.page === 'guide' && exportData && (
diff --git a/src/ui/fullview/components/ConfirmDeleteModal.tsx b/src/ui/fullview/components/ConfirmDeleteModal.tsx
index a4cc0de..7144127 100644
--- a/src/ui/fullview/components/ConfirmDeleteModal.tsx
+++ b/src/ui/fullview/components/ConfirmDeleteModal.tsx
@@ -1,4 +1,5 @@
import { Trash2 } from 'lucide-react';
+import { i18n } from '#imports';
import { Dialog, DialogContent, DialogDescription, DialogTitle } from '@/ui/components/ui/dialog';
interface ConfirmDeleteModalProps {
@@ -16,22 +17,20 @@ export default function ConfirmDeleteModal({ open, onClose, onConfirm }: Confirm
<Trash2 size={22} className="text-destructive" />
</div>
</div>
- <DialogTitle className="text-center text-base">Delete guide?</DialogTitle>
- <DialogDescription className="text-center">
- This will permanently delete this guide. This cannot be undone.
- </DialogDescription>
+ <DialogTitle className="text-center text-base">{i18n.t('confirmDelete_title')}</DialogTitle>
+ <DialogDescription className="text-center">{i18n.t('confirmDelete_message')}</DialogDescription>
<div className="flex flex-col gap-2 mt-2">
<button
onClick={onConfirm}
className="w-full py-2.5 rounded-lg bg-destructive text-white text-sm font-semibold hover:bg-destructive/90 transition-colors"
>
- Delete permanently
+ {i18n.t('confirmDelete_confirm')}
</button>
<button
onClick={onClose}
className="w-full py-2.5 rounded-lg bg-secondary text-foreground text-sm font-semibold hover:bg-lavender transition-colors"
>
- Cancel
+ {i18n.t('common_cancel')}
</button>
</div>
</DialogContent>
diff --git a/src/ui/fullview/components/GuideGridView.tsx b/src/ui/fullview/components/GuideGridView.tsx
index cc6bd9d..8e84ca4 100644
--- a/src/ui/fullview/components/GuideGridView.tsx
+++ b/src/ui/fullview/components/GuideGridView.tsx
@@ -1,5 +1,6 @@
import { MoreVertical, RotateCcw, Star, StarOff, Trash2 } from 'lucide-react';
import { useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import { formatDate } from '@/lib/utils';
import { useFullview } from '@/stores/fullview';
import ZoomScreenshot from '@/ui/sidepanel/ZoomScreenshot';
@@ -64,7 +65,7 @@ function CardMenu({
if (category === 'trash') {
items.push({
icon: <RotateCcw size={13} />,
- label: 'Restore',
+ label: i18n.t('common_restore'),
onClick: (e) => {
onRestore(e, guideId);
setOpen(false);
@@ -72,7 +73,7 @@ function CardMenu({
});
items.push({
icon: <Trash2 size={13} />,
- label: 'Delete permanently',
+ label: i18n.t('library_deletePermanently'),
onClick: (e) => {
onPermanentDelete(e, guideId);
setOpen(false);
@@ -82,7 +83,7 @@ function CardMenu({
} else {
items.push({
icon: starred ? <StarOff size={13} /> : <Star size={13} />,
- label: starred ? 'Unstar' : 'Star',
+ label: starred ? i18n.t('common_unstar') : i18n.t('common_star'),
onClick: (e) => {
onStar(e, guideId);
setOpen(false);
@@ -90,7 +91,7 @@ function CardMenu({
});
items.push({
icon: <Trash2 size={13} />,
- label: 'Move to trash',
+ label: i18n.t('library_moveToTrash'),
onClick: (e) => {
onTrash(e, guideId);
setOpen(false);
@@ -160,8 +161,10 @@ export default function GuideGridView({ category, onStar, onTrash, onRestore, on
<div className="min-w-0 flex-1">
<p className="text-sm font-medium truncate text-foreground">{guide.title}</p>
<p className="text-xs mt-0.5 text-muted-foreground">
- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} &middot;{' '}
- {formatDate(guide.updatedAt)}
+ {guide.stepIds.length !== 1
+ ? i18n.t('fullview_stepCountPlural', [String(guide.stepIds.length)])
+ : i18n.t('fullview_stepCount', [String(guide.stepIds.length)])}{' '}
+ &middot; {formatDate(guide.updatedAt)}
</p>
</div>
<CardMenu
diff --git a/src/ui/fullview/components/GuideListView.tsx b/src/ui/fullview/components/GuideListView.tsx
index bb24d8b..6135501 100644
--- a/src/ui/fullview/components/GuideListView.tsx
+++ b/src/ui/fullview/components/GuideListView.tsx
@@ -1,4 +1,5 @@
import { RotateCcw, Star, Trash2 } from 'lucide-react';
+import { i18n } from '#imports';
import { formatDate } from '@/lib/utils';
import { useFullview } from '@/stores/fullview';
import { navigate } from '../router';
@@ -26,7 +27,10 @@ export default function GuideListView({ category, onStar, onTrash, onRestore, on
<div className="flex-1 min-w-0">
<p className="text-sm font-medium truncate text-foreground">{guide.title}</p>
<p className="text-xs mt-0.5 text-muted-foreground">
- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''} &middot; {formatDate(guide.updatedAt)}
+ {guide.stepIds.length !== 1
+ ? i18n.t('fullview_stepCountPlural', [String(guide.stepIds.length)])
+ : i18n.t('fullview_stepCount', [String(guide.stepIds.length)])}{' '}
+ &middot; {formatDate(guide.updatedAt)}
</p>
</div>
<div className="flex items-center gap-1 opacity-0 group-hover:opacity-100 transition-opacity">
@@ -35,14 +39,14 @@ export default function GuideListView({ category, onStar, onTrash, onRestore, on
<button
onClick={(e) => onStar(e, guide.id)}
className="p-1.5 rounded-lg transition-colors text-purple hover:text-accent"
- title={guide.starred ? 'Unstar' : 'Star'}
+ title={guide.starred ? i18n.t('common_unstar') : i18n.t('common_star')}
>
<Star size={14} fill={guide.starred ? 'currentColor' : 'none'} />
</button>
<button
onClick={(e) => onTrash(e, guide.id)}
className="p-1.5 rounded-lg transition-colors text-purple hover:text-destructive"
- title="Move to trash"
+ title={i18n.t('library_moveToTrash')}
>
<Trash2 size={14} />
</button>
@@ -52,14 +56,14 @@ export default function GuideListView({ category, onStar, onTrash, onRestore, on
<button
onClick={(e) => onRestore(e, guide.id)}
className="p-1.5 rounded-lg transition-colors text-purple hover:text-success"
- title="Restore"
+ title={i18n.t('common_restore')}
>
<RotateCcw size={14} />
</button>
<button
onClick={(e) => onPermanentDelete(e, guide.id)}
className="p-1.5 rounded-lg transition-colors text-purple hover:text-destructive"
- title="Delete permanently"
+ title={i18n.t('library_deletePermanently')}
>
<Trash2 size={14} />
</button>
diff --git a/src/ui/fullview/components/KeyboardHints.tsx b/src/ui/fullview/components/KeyboardHints.tsx
index e38c908..70b516b 100644
--- a/src/ui/fullview/components/KeyboardHints.tsx
+++ b/src/ui/fullview/components/KeyboardHints.tsx
@@ -1,7 +1,9 @@
+import { i18n } from '#imports';
+
const hints = [
- { key: '↑↓', label: 'navigate' },
- { key: '↡', label: 'open' },
- { key: 'esc', label: 'close' },
+ { key: '↑↓', labelKey: 'keyboard_navigate' as const },
+ { key: '↡', labelKey: 'keyboard_open' as const },
+ { key: 'esc', labelKey: 'keyboard_close' as const },
];
export default function KeyboardHints() {
@@ -10,7 +12,7 @@ export default function KeyboardHints() {
{hints.map((h) => (
<span key={h.key} className="contents">
<span className="text-[9px] font-semibold px-1.5 py-0.5 rounded bg-lavender text-foreground">{h.key}</span>
- <span className="text-[10px] text-purple">{h.label}</span>
+ <span className="text-[10px] text-purple">{i18n.t(h.labelKey)}</span>
</span>
))}
</div>
diff --git a/src/ui/fullview/components/SearchResults.tsx b/src/ui/fullview/components/SearchResults.tsx
index 0fbc5b1..6393621 100644
--- a/src/ui/fullview/components/SearchResults.tsx
+++ b/src/ui/fullview/components/SearchResults.tsx
@@ -1,3 +1,4 @@
+import { i18n } from '#imports';
import type { Guide } from '@/core/guides/types';
import { formatDateShort } from '@/lib/utils';
import FaviconImg from '@/ui/shared/FaviconImg';
@@ -19,7 +20,9 @@ export default function SearchResults({ results, query, selected, onSelect, onHo
if (results.length === 0) {
return (
<div className="py-8 text-center">
- <p className="text-sm text-purple">{query ? 'No matching guides' : 'No guides yet'}</p>
+ <p className="text-sm text-purple">
+ {query ? i18n.t('search_noMatchingGuides') : i18n.t('search_noGuidesYet')}
+ </p>
</div>
);
}
@@ -67,8 +70,10 @@ export default function SearchResults({ results, query, selected, onSelect, onHo
className="text-[10px] mt-0.5"
style={{ color: i === selected ? 'rgba(199,210,254,0.6)' : 'var(--color-muted-foreground)' }}
>
- {r.guide.stepIds.length} step{r.guide.stepIds.length !== 1 ? 's' : ''} Β·{' '}
- {formatDateShort(r.guide.updatedAt)}
+ {r.guide.stepIds.length !== 1
+ ? i18n.t('fullview_stepCountPlural', [String(r.guide.stepIds.length)])
+ : i18n.t('fullview_stepCount', [String(r.guide.stepIds.length)])}{' '}
+ Β· {formatDateShort(r.guide.updatedAt)}
</p>
</div>
</div>
diff --git a/src/ui/onboarding/App.tsx b/src/ui/onboarding/App.tsx
index b8879e7..1bfbfd7 100644
--- a/src/ui/onboarding/App.tsx
+++ b/src/ui/onboarding/App.tsx
@@ -1,9 +1,19 @@
import { useEffect, useState } from 'react';
-import { browser } from '#imports';
+import { browser, i18n } from '#imports';
import { PRESET_LABELS, type PresetKey } from '@/core/blur/regexes';
import { AI_PROVIDERS, type AIProviderKey } from '@/core/capture/ai/models';
+import { AI_LANGUAGES, type AILanguageCode } from '@/core/capture/ai/prompts';
import { localStorage } from '@/lib/browser-api';
+const BLUR_PRESET_I18N: Record<PresetKey, string> = {
+ email: 'email',
+ phone: 'phoneNumbers',
+ ssn: 'ssn',
+ creditCard: 'creditCard',
+ ipAddress: 'ipAddress',
+ macAddress: 'macAddress',
+};
+
function MascotLarge({ size = 280 }: { size?: number }) {
return (
<svg viewBox="0 0 200 200" width={size} height={size}>
@@ -51,20 +61,19 @@ function WelcomeStep({ onNext }: { onNext: () => void }) {
<div className="flex-1 flex flex-col justify-center" style={{ padding: '80px 64px' }}>
<div className="max-w-lg">
<span className="inline-flex text-xs font-semibold text-accent bg-secondary px-3.5 py-1.5 rounded-full mb-6">
- Welcome
+ {i18n.t('onboarding.welcomeBadge')}
</span>
<h1 className="text-4xl font-extrabold text-foreground leading-tight mb-3 tracking-tight">
- You've successfully installed Mimik!
+ {i18n.t('onboarding.welcomeTitle')}
</h1>
<p className="text-base text-muted-foreground leading-relaxed mb-10 max-w-md">
- With just a few steps, you'll be ready to auto-capture browser workflows and generate step-by-step guides.
- No account needed β€” everything stays in your browser.
+ {i18n.t('onboarding.welcomeMessage')}
</p>
<button
onClick={onNext}
className="inline-flex items-center gap-2 px-7 py-3 bg-accent text-white rounded-xl font-semibold text-sm hover:bg-accent/90 transition-colors"
>
- Get started
+ {i18n.t('onboarding.getStarted')}
<svg
width="16"
height="16"
@@ -94,6 +103,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
const [provider, setProvider] = useState<AIProviderKey>('openai');
const [model, setModel] = useState(AI_PROVIDERS.openai.defaultModel);
const [apiKey, setApiKey] = useState('');
+ const [aiLanguage, setAiLanguage] = useState<AILanguageCode>('en');
const providerConfig = AI_PROVIDERS[provider];
@@ -103,9 +113,10 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
};
const handleContinue = async () => {
- if (apiKey) {
- await localStorage.set({ aiApiKey: apiKey, aiProvider: provider, aiModel: model });
- }
+ await localStorage.set({
+ ...(apiKey ? { aiApiKey: apiKey, aiProvider: provider, aiModel: model } : {}),
+ aiLanguage,
+ });
onNext();
};
@@ -113,16 +124,17 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
<div className="flex h-screen">
<div className="flex-1 flex flex-col justify-center" style={{ padding: '80px 64px' }}>
<div className="max-w-md">
- <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">Step 1 of 3</p>
- <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">AI Descriptions</h1>
- <p className="text-sm text-muted-foreground leading-relaxed mb-8">
- Connect your own API key to get AI-generated step descriptions. This is optional and can be changed later in
- settings.
+ <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">
+ {i18n.t('onboarding.aiStepLabel')}
</p>
+ <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">{i18n.t('onboarding.aiTitle')}</h1>
+ <p className="text-sm text-muted-foreground leading-relaxed mb-8">{i18n.t('onboarding.aiMessage')}</p>
<div className="space-y-4 mb-8">
<div>
- <label className="block text-xs font-semibold text-foreground mb-1.5">Provider</label>
+ <label className="block text-xs font-semibold text-foreground mb-1.5">
+ {i18n.t('settings.provider')}
+ </label>
<select
value={provider}
onChange={(e) => handleProviderChange(e.target.value as AIProviderKey)}
@@ -137,7 +149,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
</div>
<div>
- <label className="block text-xs font-semibold text-foreground mb-1.5">Model</label>
+ <label className="block text-xs font-semibold text-foreground mb-1.5">{i18n.t('settings.model')}</label>
<select
value={model}
onChange={(e) => setModel(e.target.value)}
@@ -152,7 +164,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
</div>
<div>
- <label className="block text-xs font-semibold text-foreground mb-1.5">API Key</label>
+ <label className="block text-xs font-semibold text-foreground mb-1.5">{i18n.t('settings.apiKey')}</label>
<input
type="password"
value={apiKey}
@@ -161,6 +173,23 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
className="w-full border border-border rounded-xl px-4 py-2.5 text-sm text-foreground bg-card font-medium outline-none focus:border-accent focus:ring-2 focus:ring-accent/10 placeholder:text-muted-foreground/50"
/>
</div>
+
+ <div>
+ <label className="block text-xs font-semibold text-foreground mb-1.5">
+ {i18n.t('settings.aiLanguage')}
+ </label>
+ <select
+ value={aiLanguage}
+ onChange={(e) => setAiLanguage(e.target.value as AILanguageCode)}
+ className="w-full border border-border rounded-xl px-4 py-2.5 text-sm text-foreground bg-card font-medium outline-none focus:border-accent focus:ring-2 focus:ring-accent/10"
+ >
+ {AI_LANGUAGES.map((lang) => (
+ <option key={lang.code} value={lang.code}>
+ {lang.label}
+ </option>
+ ))}
+ </select>
+ </div>
</div>
<div className="flex items-center gap-3">
@@ -168,13 +197,13 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
onClick={handleContinue}
className="px-8 py-3 bg-accent text-white rounded-xl font-semibold text-sm hover:bg-accent/90 transition-colors"
>
- Continue
+ {i18n.t('common.continue')}
</button>
<button
onClick={onSkip}
className="px-6 py-3 text-muted-foreground rounded-xl font-semibold text-sm hover:text-foreground transition-colors"
>
- Skip
+ {i18n.t('common.skip')}
</button>
</div>
@@ -204,7 +233,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
</svg>
<div className="bg-white rounded-2xl p-9 shadow-lg max-w-sm">
<p className="text-[10px] font-semibold text-muted-foreground uppercase tracking-widest mb-4">
- AI-generated description
+ {i18n.t('onboarding.aiGeneratedDescription')}
</p>
<div className="flex gap-3 mb-5">
<div className="w-7 h-7 rounded-full bg-accent text-white text-xs font-bold flex items-center justify-center shrink-0">
@@ -220,7 +249,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
<svg width="10" height="10" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2L14 10L22 12L14 14L12 22L10 14L2 12L10 10Z" />
</svg>
- AI generated
+ {i18n.t('onboarding.aiGenerated')}
</span>
</div>
</div>
@@ -238,7 +267,7 @@ function AISetupStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => voi
<svg width="10" height="10" viewBox="0 0 24 24" fill="currentColor">
<path d="M12 2L14 10L22 12L14 14L12 22L10 14L2 12L10 10Z" />
</svg>
- AI generated
+ {i18n.t('onboarding.aiGenerated')}
</span>
</div>
</div>
@@ -271,19 +300,23 @@ function SmartBlurStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => v
<div className="flex h-screen">
<div className="flex-1 flex flex-col justify-center" style={{ padding: '80px 64px' }}>
<div className="max-w-md">
- <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">Step 2 of 3</p>
- <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">Smart Blur</h1>
- <p className="text-sm text-muted-foreground leading-relaxed mb-8">
- Automatically blur sensitive information in screenshots. Choose which patterns to detect.
+ <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">
+ {i18n.t('onboarding.blurStepLabel')}
</p>
+ <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">
+ {i18n.t('onboarding.blurTitle')}
+ </h1>
+ <p className="text-sm text-muted-foreground leading-relaxed mb-8">{i18n.t('onboarding.blurMessage')}</p>
<div className="space-y-1 mb-8 border border-border rounded-2xl p-4">
- {(Object.entries(PRESET_LABELS) as [PresetKey, string][]).map(([key, label], i, arr) => (
+ {(Object.keys(PRESET_LABELS) as PresetKey[]).map((key, i, arr) => (
<div
key={key}
className={`flex items-center justify-between py-3 ${i < arr.length - 1 ? 'border-b border-secondary' : ''}`}
>
- <span className="text-sm font-medium text-foreground">{label}</span>
+ <span className="text-sm font-medium text-foreground">
+ {i18n.t(`blurPresets.${BLUR_PRESET_I18N[key]}`)}
+ </span>
<button
onClick={() => handleToggle(key)}
className={`w-11 h-6 rounded-full transition-colors relative ${
@@ -305,13 +338,13 @@ function SmartBlurStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => v
onClick={onNext}
className="px-8 py-3 bg-accent text-white rounded-xl font-semibold text-sm hover:bg-accent/90 transition-colors"
>
- Continue
+ {i18n.t('common.continue')}
</button>
<button
onClick={onSkip}
className="px-6 py-3 text-muted-foreground rounded-xl font-semibold text-sm hover:text-foreground transition-colors"
>
- Skip
+ {i18n.t('common.skip')}
</button>
</div>
@@ -324,13 +357,23 @@ function SmartBlurStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => v
<div className="absolute w-[350px] h-[350px] bg-[radial-gradient(circle,rgba(79,70,229,0.25),transparent_70%)] bottom-[20%] right-[20%]" />
<div className="animate-[float_4s_ease-in-out_infinite] relative z-10">
<div className="bg-white rounded-2xl p-7 shadow-lg" style={{ minWidth: 320 }}>
- <p className="text-xs font-semibold text-foreground mb-4">Screenshot preview</p>
+ <p className="text-xs font-semibold text-foreground mb-4">{i18n.t('onboarding.screenshotPreview')}</p>
{[
- { icon: '@', label: 'Email', value: '[email protected]', blurred: true },
- { icon: '#', label: 'Phone', value: '(555) 867-5309', blurred: true },
- { icon: 'ID', label: 'SSN', value: 'Not enabled', blurred: false },
- { icon: '$', label: 'Card', value: 'Not enabled', blurred: false },
- { icon: 'IP', label: 'Address', value: 'Not enabled', blurred: false },
+ { icon: '@', label: i18n.t('blurPresets.email'), value: '[email protected]', blurred: true },
+ { icon: '#', label: i18n.t('blurPresets.phoneNumbers'), value: '(555) 867-5309', blurred: true },
+ { icon: 'ID', label: i18n.t('blurPresets.ssn'), value: i18n.t('onboarding.notEnabled'), blurred: false },
+ {
+ icon: '$',
+ label: i18n.t('blurPresets.creditCard'),
+ value: i18n.t('onboarding.notEnabled'),
+ blurred: false,
+ },
+ {
+ icon: 'IP',
+ label: i18n.t('blurPresets.ipAddress'),
+ value: i18n.t('onboarding.notEnabled'),
+ blurred: false,
+ },
].map((row, i, arr) => (
<div
key={row.label}
@@ -359,7 +402,7 @@ function SmartBlurStep({ onNext, onSkip }: { onNext: () => void; onSkip: () => v
>
<path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" />
</svg>
- 2 categories protected
+ {i18n.t('onboarding.categoriesProtected', ['2'])}
</div>
</div>
</div>
@@ -373,11 +416,13 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
<div className="flex h-screen">
<div className="flex-1 flex flex-col justify-center" style={{ padding: '80px 64px' }}>
<div className="max-w-md">
- <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">Step 3 of 3</p>
- <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">Pin Mimik</h1>
- <p className="text-sm text-muted-foreground leading-relaxed mb-8">
- Pin the extension to your toolbar for quick access. Click the puzzle icon in Chrome, then pin Mimik.
+ <p className="text-xs font-semibold text-accent mb-2 tracking-wide uppercase">
+ {i18n.t('onboarding.pinStepLabel')}
</p>
+ <h1 className="text-3xl font-extrabold text-foreground leading-tight mb-2">
+ {i18n.t('onboarding.pinTitle')}
+ </h1>
+ <p className="text-sm text-muted-foreground leading-relaxed mb-8">{i18n.t('onboarding.pinMessage')}</p>
<ol className="space-y-4 mb-8">
<li className="flex items-start gap-3">
@@ -385,8 +430,8 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
<span className="text-accent text-xs font-bold">1</span>
</div>
<div>
- <p className="text-sm font-medium text-foreground">Click the puzzle icon</p>
- <p className="text-xs text-muted-foreground">In the top-right of your browser toolbar</p>
+ <p className="text-sm font-medium text-foreground">{i18n.t('onboarding.pinStep1Title')}</p>
+ <p className="text-xs text-muted-foreground">{i18n.t('onboarding.pinStep1Sub')}</p>
</div>
</li>
<li className="flex items-start gap-3">
@@ -394,8 +439,8 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
<span className="text-accent text-xs font-bold">2</span>
</div>
<div>
- <p className="text-sm font-medium text-foreground">Find Mimik</p>
- <p className="text-xs text-muted-foreground">In the extensions dropdown</p>
+ <p className="text-sm font-medium text-foreground">{i18n.t('onboarding.pinStep2Title')}</p>
+ <p className="text-xs text-muted-foreground">{i18n.t('onboarding.pinStep2Sub')}</p>
</div>
</li>
<li className="flex items-start gap-3">
@@ -403,8 +448,8 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
<span className="text-accent text-xs font-bold">3</span>
</div>
<div>
- <p className="text-sm font-medium text-foreground">Click the pin icon</p>
- <p className="text-xs text-muted-foreground">Mimik will appear in your toolbar</p>
+ <p className="text-sm font-medium text-foreground">{i18n.t('onboarding.pinStep3Title')}</p>
+ <p className="text-xs text-muted-foreground">{i18n.t('onboarding.pinStep3Sub')}</p>
</div>
</li>
</ol>
@@ -414,13 +459,13 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
onClick={onNext}
className="px-8 py-3 bg-accent text-white rounded-xl font-semibold text-sm hover:bg-accent/90 transition-colors"
>
- Continue
+ {i18n.t('common.continue')}
</button>
<button
onClick={onSkip}
className="px-6 py-3 text-muted-foreground rounded-xl font-semibold text-sm hover:text-foreground transition-colors"
>
- Skip
+ {i18n.t('common.skip')}
</button>
</div>
@@ -432,7 +477,11 @@ function PinExtensionStep({ onNext, onSkip }: { onNext: () => void; onSkip: () =
<div className="w-1/2 bg-deep flex items-center justify-center relative overflow-hidden">
<div className="absolute w-[400px] h-[400px] bg-[radial-gradient(circle,rgba(79,70,229,0.2),transparent_70%)] top-[10%] right-[-10%]" />
<div className="animate-[float_4s_ease-in-out_infinite] relative z-10">
- <img src="/pin-screenshot.png" alt="Pin Mimik extension" className="rounded-xl shadow-2xl max-w-[400px]" />
+ <img
+ src="/pin-screenshot.png"
+ alt={i18n.t('onboarding.pinScreenshotAlt')}
+ className="rounded-xl shadow-2xl max-w-[400px]"
+ />
</div>
</div>
</div>
@@ -450,15 +499,17 @@ function DoneStep() {
<div className="flex justify-center mb-8 animate-[float_3s_ease-in-out_infinite]">
<MascotLarge size={120} />
</div>
- <h1 className="text-4xl font-extrabold text-foreground mb-3 tracking-tight">You're all set!</h1>
+ <h1 className="text-4xl font-extrabold text-foreground mb-3 tracking-tight">
+ {i18n.t('onboarding.doneTitle')}
+ </h1>
<p className="text-base text-muted-foreground mb-8 max-w-md mx-auto leading-relaxed">
- Mimik is ready to capture your workflows. Click "Start Capture" in the extension to record your first guide.
+ {i18n.t('onboarding.doneMessage')}
</p>
<div className="flex gap-4 justify-center mb-8">
{[
{
- label: 'Auto-capture',
+ label: i18n.t('onboarding.featureAutoCapture'),
icon: (
<svg
width="28"
@@ -475,7 +526,7 @@ function DoneStep() {
),
},
{
- label: 'AI descriptions',
+ label: i18n.t('onboarding.featureAIDescriptions'),
icon: (
<svg
width="28"
@@ -491,7 +542,7 @@ function DoneStep() {
),
},
{
- label: 'Smart blur',
+ label: i18n.t('onboarding.featureSmartBlur'),
icon: (
<svg
width="28"
@@ -519,7 +570,7 @@ function DoneStep() {
onClick={handleOpen}
className="inline-flex items-center gap-2 px-7 py-3 bg-accent text-white rounded-xl font-semibold text-sm hover:bg-accent/90 transition-colors"
>
- Open Mimik
+ {i18n.t('onboarding.openMimik')}
<svg
width="16"
height="16"
diff --git a/src/ui/shared/EmptyGuideState.tsx b/src/ui/shared/EmptyGuideState.tsx
index 44fd000..7bed19f 100644
--- a/src/ui/shared/EmptyGuideState.tsx
+++ b/src/ui/shared/EmptyGuideState.tsx
@@ -1,3 +1,5 @@
+import { i18n } from '#imports';
+
export default function EmptyGuideState() {
return (
<div className="flex flex-col items-center justify-center flex-1 min-h-[300px]">
@@ -22,8 +24,8 @@ export default function EmptyGuideState() {
<span className="text-[10px] animate-pulse [animation-delay:800ms]">z</span>
</div>
</div>
- <p className="text-sm font-medium text-foreground mt-5">This guide is empty</p>
- <p className="text-xs text-muted-foreground mt-1">Wake it up by recording some steps</p>
+ <p className="text-sm font-medium text-foreground mt-5">{i18n.t('emptyGuide.title')}</p>
+ <p className="text-xs text-muted-foreground mt-1">{i18n.t('emptyGuide.subtitle')}</p>
</div>
);
}
diff --git a/src/ui/shared/SettingsView.tsx b/src/ui/shared/SettingsView.tsx
index 6aa5416..8312378 100644
--- a/src/ui/shared/SettingsView.tsx
+++ b/src/ui/shared/SettingsView.tsx
@@ -1,7 +1,9 @@
-import { ArrowLeft, Bug, Check, ChevronRight, EyeOff, Shield, Sparkles, Star } from 'lucide-react';
+import { ArrowLeft, Bug, Check, ChevronRight, EyeOff, Globe, Shield, Sparkles, Star } from 'lucide-react';
import { useEffect, useState } from 'react';
+import { i18n } from '#imports';
import { PRESET_LABELS, type PresetKey } from '@/core/blur/regexes';
import { AI_PROVIDERS, type AIProviderKey } from '@/core/capture/ai/models';
+import { AI_LANGUAGES, type AILanguageCode } from '@/core/capture/ai/prompts';
import { localStorage } from '@/lib/browser-api';
import { Button } from '@/ui/components/ui/button';
import { Input } from '@/ui/components/ui/input';
@@ -15,6 +17,7 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
const [model, setModel] = useState(AI_PROVIDERS.openai.defaultModel);
const [apiKey, setApiKey] = useState('');
const [saved, setSaved] = useState(false);
+ const [aiLanguage, setAiLanguage] = useState<AILanguageCode>('en');
const [blurPresets, setBlurPresets] = useState<Record<PresetKey, boolean>>({
email: true,
phone: true,
@@ -25,11 +28,12 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
});
useEffect(() => {
- localStorage.get(['aiApiKey', 'aiProvider', 'aiModel', 'blurPresets']).then((result) => {
+ localStorage.get(['aiApiKey', 'aiProvider', 'aiModel', 'aiLanguage', 'blurPresets']).then((result) => {
const p = (result.aiProvider as AIProviderKey) || 'openai';
setProvider(p);
setModel((result.aiModel as string) || AI_PROVIDERS[p].defaultModel);
if (result.aiApiKey) setApiKey(result.aiApiKey as string);
+ if (result.aiLanguage) setAiLanguage(result.aiLanguage as AILanguageCode);
if (result.blurPresets) setBlurPresets(result.blurPresets as Record<PresetKey, boolean>);
});
}, []);
@@ -40,13 +44,22 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
};
const handleSave = async () => {
- await localStorage.set({ aiApiKey: apiKey, aiProvider: provider, aiModel: model, blurPresets });
+ await localStorage.set({ aiApiKey: apiKey, aiProvider: provider, aiModel: model, aiLanguage, blurPresets });
setSaved(true);
setTimeout(() => setSaved(false), 2000);
};
const providerConfig = AI_PROVIDERS[provider];
+ const BLUR_PRESET_I18N: Record<PresetKey, string> = {
+ email: 'blurPresets.email',
+ phone: 'blurPresets.phoneNumbers',
+ ssn: 'blurPresets.ssn',
+ creditCard: 'blurPresets.creditCard',
+ ipAddress: 'blurPresets.ipAddress',
+ macAddress: 'blurPresets.macAddress',
+ };
+
return (
<div className="bg-card flex flex-col">
<div className="flex items-center gap-3 px-4 py-3 border-b border-border">
@@ -58,7 +71,7 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
<ArrowLeft size={16} />
</button>
)}
- <h1 className="text-[15px] font-bold text-foreground">Settings</h1>
+ <h1 className="text-[15px] font-bold text-foreground">{i18n.t('settings.title')}</h1>
</div>
<div className="flex-1 px-3 py-4 space-y-3">
@@ -67,11 +80,13 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
<div className="w-7 h-7 rounded-lg bg-secondary flex items-center justify-center">
<Sparkles size={14} className="text-accent" />
</div>
- <span className="text-xs font-bold text-foreground">AI Descriptions</span>
+ <span className="text-xs font-bold text-foreground">{i18n.t('settings.aiDescriptions')}</span>
</div>
<div>
- <label className="block text-[11px] font-semibold text-foreground mb-1">Provider</label>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">
+ {i18n.t('settings.provider')}
+ </label>
<select
value={provider}
onChange={(e) => handleProviderChange(e.target.value as AIProviderKey)}
@@ -86,7 +101,7 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
</div>
<div>
- <label className="block text-[11px] font-semibold text-foreground mb-1">Model</label>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">{i18n.t('settings.model')}</label>
<select
value={model}
onChange={(e) => setModel(e.target.value)}
@@ -101,9 +116,27 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
</div>
<div>
- <label className="block text-[11px] font-semibold text-foreground mb-1">API Key</label>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">{i18n.t('settings.apiKey')}</label>
<Input type="password" value={apiKey} onChange={(e) => setApiKey(e.target.value)} placeholder="sk-..." />
</div>
+
+ <div>
+ <label className="block text-[11px] font-semibold text-foreground mb-1">
+ <Globe size={11} className="inline mr-1 -mt-px" />
+ {i18n.t('settings.aiLanguage')}
+ </label>
+ <select
+ value={aiLanguage}
+ onChange={(e) => setAiLanguage(e.target.value as AILanguageCode)}
+ className="w-full border border-border rounded-lg px-3 py-2 text-[13px] text-foreground bg-card font-medium outline-none focus:border-ring focus:ring-2 focus:ring-ring/10"
+ >
+ {AI_LANGUAGES.map((lang) => (
+ <option key={lang.code} value={lang.code}>
+ {lang.label}
+ </option>
+ ))}
+ </select>
+ </div>
</div>
<div className="border border-border rounded-[10px] p-3.5 space-y-1">
@@ -111,15 +144,15 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
<div className="w-7 h-7 rounded-lg bg-secondary flex items-center justify-center">
<EyeOff size={14} className="text-accent" />
</div>
- <span className="text-xs font-bold text-foreground">Smart Blur</span>
+ <span className="text-xs font-bold text-foreground">{i18n.t('settings.smartBlur')}</span>
</div>
- {(Object.entries(PRESET_LABELS) as [PresetKey, string][]).map(([key, label], i, arr) => (
+ {(Object.keys(PRESET_LABELS) as PresetKey[]).map((key, i, arr) => (
<div
key={key}
className={`flex items-center justify-between py-2 ${i < arr.length - 1 ? 'border-b border-secondary' : ''}`}
>
- <span className="text-xs font-medium text-foreground">{label}</span>
+ <span className="text-xs font-medium text-foreground">{i18n.t(BLUR_PRESET_I18N[key])}</span>
<button
onClick={() =>
setBlurPresets((prev) => {
@@ -149,15 +182,12 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
style={saved ? { backgroundColor: 'var(--color-success)', color: '#fff', opacity: 0.9 } : undefined}
>
{saved && <Check size={16} />}
- {saved ? 'Saved' : 'Save Settings'}
+ {saved ? i18n.t('settings.saved') : i18n.t('settings.saveSettings')}
</Button>
<div className="flex items-start gap-2 px-3 py-2.5 rounded-lg bg-secondary text-[10px] text-muted-foreground leading-relaxed">
<Shield size={12} className="shrink-0 mt-0.5 text-accent" />
- <span>
- Your API key is stored locally and only sent to the selected AI provider. No data leaves your browser
- otherwise.
- </span>
+ <span>{i18n.t('settings.privacyNotice')}</span>
</div>
<a
@@ -167,7 +197,7 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
className="flex items-center gap-2.5 px-3 py-2.5 rounded-lg border border-border text-[11px] font-medium text-muted-foreground hover:text-foreground hover:border-accent transition-colors"
>
<Bug size={13} className="shrink-0" />
- <span>Found a bug? Report it on GitHub</span>
+ <span>{i18n.t('settings.bugReport')}</span>
</a>
<div className="flex items-center gap-3.5 border border-border rounded-[10px] p-3.5">
@@ -180,9 +210,9 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
<path d="M84 138 Q100 148 116 138" stroke="#C7D2FE" strokeWidth="3.5" fill="none" strokeLinecap="round" />
</svg>
<div className="flex-1 min-w-0">
- <p className="text-xs font-bold text-foreground mb-0.5">Like what you see?</p>
+ <p className="text-xs font-bold text-foreground mb-0.5">{i18n.t('settings.starCtaTitle')}</p>
<p className="text-[10px] text-muted-foreground leading-relaxed mb-2">
- A GitHub star helps others find Mimik and keeps us motivated!
+ {i18n.t('settings.starCtaMessage')}
</p>
<a
href="https://github.com/westpoint-io/mimik"
@@ -191,7 +221,7 @@ export default function SettingsView({ onBack }: SettingsViewProps) {
className="inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-secondary text-[10px] font-semibold text-accent hover:bg-accent hover:text-white transition-colors"
>
<Star size={11} fill="#FBBF24" className="text-[#FBBF24]" />
- Star on GitHub
+ {i18n.t('settings.starOnGithub')}
<ChevronRight size={11} />
</a>
</div>
diff --git a/src/ui/sidepanel/App.tsx b/src/ui/sidepanel/App.tsx
index 6cad367..289e8b8 100644
--- a/src/ui/sidepanel/App.tsx
+++ b/src/ui/sidepanel/App.tsx
@@ -1,6 +1,6 @@
import { Search, Settings, Video } from 'lucide-react';
import { useCallback, useEffect, useState } from 'react';
-import { browser } from '#imports';
+import { browser, i18n } from '#imports';
import { CaptureState } from '@/core/capture/machine';
import type { GuideMeSession } from '@/core/guideme/session';
import { SESSION_KEY } from '@/core/guideme/session';
@@ -204,12 +204,12 @@ export default function App() {
<div className="absolute -top-12 -right-8 w-44 h-44 rounded-full opacity-15 blur-[40px] bg-gradient-to-br from-lavender to-white" />
<div className="relative flex items-center justify-between mb-6">
- <span className="text-[17px] font-bold tracking-tight text-foreground">Mimik</span>
+ <span className="text-[17px] font-bold tracking-tight text-foreground">{i18n.t('app.name')}</span>
<div className="flex items-center gap-2">
<span
className={`text-[10px] font-medium px-2.5 py-0.5 rounded-full ${isAlive ? 'text-foreground bg-white/30' : 'text-deep/50 bg-white/15'}`}
>
- {isAlive ? 'Connected' : 'Connecting...'}
+ {isAlive ? i18n.t('sidepanel.connected') : i18n.t('sidepanel.connecting')}
</span>
<button
onClick={() => setView({ name: 'settings' })}
@@ -224,8 +224,8 @@ export default function App() {
<div className="flex justify-center mb-2">
<MascotIcon size={44} />
</div>
- <h3 className="text-base font-medium text-foreground">What would you like to capture?</h3>
- <p className="text-xs mt-1 text-violet-dark">Record any workflow automatically</p>
+ <h3 className="text-base font-medium text-foreground">{i18n.t('sidepanel.heroTitle')}</h3>
+ <p className="text-xs mt-1 text-violet-dark">{i18n.t('sidepanel.heroSubtitle')}</p>
</div>
<Button
@@ -234,7 +234,7 @@ export default function App() {
className="w-full py-3 px-4 h-auto rounded-lg font-semibold text-sm hover:-translate-y-px shadow-lg"
>
<Video size={18} />
- Start Capture
+ {i18n.t('sidepanel.startCapture')}
</Button>
</div>
@@ -244,14 +244,16 @@ export default function App() {
<Search size={15} className="absolute left-3.5 top-1/2 -translate-y-1/2 text-purple" />
<Input
type="text"
- placeholder="Search guides..."
+ placeholder={i18n.t('sidepanel.searchPlaceholder')}
value={search}
onChange={(e) => setSearch(e.target.value)}
className="w-full pl-10 pr-3 rounded-xl border-border bg-card !text-[13px]"
/>
</div>
- <p className="text-[11px] font-semibold uppercase tracking-wider mb-2.5 text-muted-foreground">Recent</p>
+ <p className="text-[11px] font-semibold uppercase tracking-wider mb-2.5 text-muted-foreground">
+ {i18n.t('sidepanel.recentLabel')}
+ </p>
<LibraryView
onOpen={(guideId) => setView({ name: 'editor', guideId })}
diff --git a/src/ui/sidepanel/BlurCanvas.tsx b/src/ui/sidepanel/BlurCanvas.tsx
index 69ed4ab..65f806e 100644
--- a/src/ui/sidepanel/BlurCanvas.tsx
+++ b/src/ui/sidepanel/BlurCanvas.tsx
@@ -1,5 +1,6 @@
import { Check, EyeOff, Undo, X } from 'lucide-react';
import { useCallback, useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import type { Screenshot } from '@/core/guides/types';
interface BlurCanvasProps {
@@ -192,10 +193,12 @@ export default function BlurCanvas({ screenshot, onSave, onCancel }: BlurCanvasP
<span className="w-7 h-7 rounded-full bg-primary-foreground/10 flex items-center justify-center">
<EyeOff size={14} className="text-primary-foreground" />
</span>
- <span className="text-xs font-medium text-primary-foreground">Draw rectangles to blur</span>
+ <span className="text-xs font-medium text-primary-foreground">{i18n.t('blurCanvas.drawInstructions')}</span>
{blurRects.length > 0 && (
<span className="text-[10px] font-semibold text-primary-foreground bg-primary-foreground/10 px-2 py-0.5 rounded-full">
- {blurRects.length} region{blurRects.length !== 1 ? 's' : ''}
+ {blurRects.length !== 1
+ ? i18n.t('blurCanvas.regionCountPlural', [String(blurRects.length)])
+ : i18n.t('blurCanvas.regionCount', [String(blurRects.length)])}
</span>
)}
</div>
@@ -206,21 +209,21 @@ export default function BlurCanvas({ screenshot, onSave, onCancel }: BlurCanvasP
className="flex items-center gap-1 px-3 py-1.5 text-[11px] font-semibold text-primary-foreground rounded-lg border border-primary-foreground/10 bg-primary-foreground/[0.06] hover:bg-primary-foreground/15 disabled:opacity-30 transition-colors"
>
<Undo size={12} />
- Undo
+ {i18n.t('common.undo')}
</button>
<button
onClick={onCancel}
className="flex items-center gap-1 px-3 py-1.5 text-[11px] font-semibold text-primary-foreground rounded-lg border border-primary-foreground/10 bg-primary-foreground/[0.06] hover:bg-destructive/15 hover:text-destructive transition-colors"
>
<X size={12} />
- Cancel
+ {i18n.t('common.cancel')}
</button>
<button
onClick={handleSave}
className="flex items-center gap-1 px-3 py-1.5 text-[11px] font-bold text-primary bg-primary-foreground rounded-lg hover:bg-primary-foreground/90 transition-colors"
>
<Check size={12} />
- Save
+ {i18n.t('common.save')}
</button>
</div>
</div>
diff --git a/src/ui/sidepanel/ExportMenu.tsx b/src/ui/sidepanel/ExportMenu.tsx
index abf5d4b..961e72f 100644
--- a/src/ui/sidepanel/ExportMenu.tsx
+++ b/src/ui/sidepanel/ExportMenu.tsx
@@ -1,5 +1,6 @@
import { Download, FileCode, FileDown, FileText, Loader2 } from 'lucide-react';
import { useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import { exportGuideAsHTML } from '@/core/export/html-export';
import { exportGuideAsMarkdown } from '@/core/export/markdown-export';
import { exportGuideAsPDF } from '@/core/export/pdf-export';
@@ -61,16 +62,16 @@ export default function ExportMenu({ guide, steps, screenshots }: ExportMenuProp
}
const items = [
- { type: 'html' as const, icon: FileCode, label: 'HTML' },
- { type: 'markdown' as const, icon: FileText, label: 'Markdown' },
- { type: 'pdf' as const, icon: FileDown, label: 'PDF' },
+ { type: 'html' as const, icon: FileCode, label: i18n.t('exportMenu.html') },
+ { type: 'markdown' as const, icon: FileText, label: i18n.t('exportMenu.markdown') },
+ { type: 'pdf' as const, icon: FileDown, label: i18n.t('exportMenu.pdf') },
];
return (
<div ref={menuRef} className="relative">
<Button size="sm" onClick={() => setOpen((prev) => !prev)} disabled={exporting}>
{exporting ? <Loader2 size={14} className="animate-spin" /> : <Download size={14} />}
- Export
+ {i18n.t('common.export')}
</Button>
{open && !exporting && (
diff --git a/src/ui/sidepanel/GuideEditor.tsx b/src/ui/sidepanel/GuideEditor.tsx
index 2c94cd0..b84eb7e 100644
--- a/src/ui/sidepanel/GuideEditor.tsx
+++ b/src/ui/sidepanel/GuideEditor.tsx
@@ -1,5 +1,6 @@
import { ArrowLeft, Layers, Maximize2, Play } from 'lucide-react';
import { useCallback, useEffect, useState } from 'react';
+import { i18n } from '#imports';
import {
deleteStep,
getGuide,
@@ -103,16 +104,16 @@ export default function GuideEditor({ guideId, onBack, onGuideMe }: GuideEditorP
[blurringStepId, data],
);
- if (loading) return <p className="text-sm text-purple p-4">Loading...</p>;
+ if (loading) return <p className="text-sm text-purple p-4">{i18n.t('common.loading')}</p>;
if (notFound || !data) {
return (
<div className="p-4">
<button onClick={onBack} className="flex items-center gap-1 text-sm text-purple hover:text-foreground mb-4">
<ArrowLeft size={18} />
- Back
+ {i18n.t('common.back')}
</button>
- <p className="text-sm text-destructive">Guide not found</p>
+ <p className="text-sm text-destructive">{i18n.t('fullview.guideNotFound')}</p>
</div>
);
}
@@ -129,7 +130,7 @@ export default function GuideEditor({ guideId, onBack, onGuideMe }: GuideEditorP
<button
onClick={onBack}
className="shrink-0 p-1 rounded text-purple hover:text-foreground"
- title="Back to library"
+ title={i18n.t('editor.backToLibrary')}
>
<ArrowLeft size={18} />
</button>
@@ -152,7 +153,7 @@ export default function GuideEditor({ guideId, onBack, onGuideMe }: GuideEditorP
});
}}
className="shrink-0 p-1.5 rounded-md transition-colors text-purple hover:text-accent hover:bg-secondary"
- title="Open in full view"
+ title={i18n.t('library.openInFullView')}
>
<Maximize2 size={15} />
</button>
@@ -164,7 +165,7 @@ export default function GuideEditor({ guideId, onBack, onGuideMe }: GuideEditorP
}}
disabled={!data.steps.some((s) => s.elementMeta)}
className="shrink-0 p-1.5 rounded-md transition-colors text-purple hover:text-accent hover:bg-secondary disabled:opacity-30 disabled:cursor-not-allowed"
- title="Guide Me"
+ title={i18n.t('editor.guideMe')}
>
<Play size={15} />
</button>
@@ -176,7 +177,9 @@ export default function GuideEditor({ guideId, onBack, onGuideMe }: GuideEditorP
<div className="text-[11px] flex items-center gap-2 text-muted-foreground" style={{ marginLeft: '34px' }}>
<span className="flex items-center gap-1">
<Layers size={11} />
- {data.steps.length} step{data.steps.length !== 1 ? 's' : ''}
+ {data.steps.length !== 1
+ ? i18n.t('fullview.stepCountPlural', [String(data.steps.length)])
+ : i18n.t('fullview.stepCount', [String(data.steps.length)])}
</span>
{(() => {
const d = getMostCommonDomain(data.steps);
diff --git a/src/ui/sidepanel/GuideMeCompletion.tsx b/src/ui/sidepanel/GuideMeCompletion.tsx
index 2d2c008..b4f930c 100644
--- a/src/ui/sidepanel/GuideMeCompletion.tsx
+++ b/src/ui/sidepanel/GuideMeCompletion.tsx
@@ -1,4 +1,5 @@
import { useEffect, useState } from 'react';
+import { i18n } from '#imports';
import { getStepsForGuide } from '@/core/guides/service';
import type { Step } from '@/core/guides/types';
@@ -43,9 +44,9 @@ export default function GuideMeCompletion({ guideId, onDone, onRunAgain }: Guide
<div className="min-h-screen bg-card flex flex-col px-7">
<div className="flex flex-col items-center text-center pt-10 pb-4">
<CoolMascot />
- <h1 className="text-[22px] font-[800] text-foreground mb-2">All done, champ!</h1>
+ <h1 className="text-[22px] font-[800] text-foreground mb-2">{i18n.t('guidemeCompletion.title')}</h1>
<p className="text-[13px] text-muted-foreground">
- All {steps.length} step{steps.length !== 1 ? 's' : ''} completed.
+ {i18n.t('guidemeCompletion.stepsCompletedPlural', [String(steps.length)])}
</p>
</div>
@@ -67,13 +68,13 @@ export default function GuideMeCompletion({ guideId, onDone, onRunAgain }: Guide
onClick={onDone}
className="flex-1 py-3.5 rounded-lg font-semibold text-sm bg-secondary border border-border text-foreground hover:bg-secondary/80 transition-colors"
>
- All Done
+ {i18n.t('guidemeCompletion.allDone')}
</button>
<button
onClick={() => onRunAgain(guideId)}
className="flex-1 py-3.5 rounded-lg font-semibold text-sm bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"
>
- Run Again
+ {i18n.t('guidemeCompletion.runAgain')}
</button>
</div>
</div>
diff --git a/src/ui/sidepanel/GuideMeView.tsx b/src/ui/sidepanel/GuideMeView.tsx
index bca9bbe..35e5ead 100644
--- a/src/ui/sidepanel/GuideMeView.tsx
+++ b/src/ui/sidepanel/GuideMeView.tsx
@@ -1,6 +1,6 @@
import { ArrowLeft, Check, ChevronLeft, ChevronRight } from 'lucide-react';
import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
-import { browser } from '#imports';
+import { browser, i18n } from '#imports';
import type { GuideMeSession } from '@/core/guideme/session';
import { SESSION_KEY } from '@/core/guideme/session';
import { getGuide } from '@/core/guides/service';
@@ -41,22 +41,20 @@ function ExitConfirmation({ onCancel, onConfirm }: { onCancel: () => void; onCon
<div className="fixed inset-0 z-20 flex items-center justify-center bg-card/80 backdrop-blur-[2px]">
<div className="bg-card rounded-2xl border border-border shadow-lg p-6 w-[280px] text-center flex flex-col items-center">
<SadMascot />
- <h3 className="text-[15px] font-bold text-foreground mt-3 mb-1">Heading out?</h3>
- <p className="text-[12px] text-muted-foreground leading-relaxed mb-5">
- Your walkthrough will stop and the page overlay will be removed.
- </p>
+ <h3 className="text-[15px] font-bold text-foreground mt-3 mb-1">{i18n.t('guideme.exitTitle')}</h3>
+ <p className="text-[12px] text-muted-foreground leading-relaxed mb-5">{i18n.t('guideme.exitMessage')}</p>
<div className="flex gap-2.5 w-full">
<button
onClick={onCancel}
className="flex-1 py-2.5 rounded-lg font-semibold text-sm bg-secondary text-foreground hover:bg-secondary/80 transition-colors"
>
- Stay
+ {i18n.t('guideme.stay')}
</button>
<button
onClick={onConfirm}
className="flex-1 py-2.5 rounded-lg font-semibold text-sm bg-primary text-primary-foreground hover:bg-primary/90 transition-colors"
>
- Exit
+ {i18n.t('guideme.exit')}
</button>
</div>
</div>
@@ -155,8 +153,8 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
};
}, [viewedStep, viewedScreenshot]);
- if (loading) return <p className="text-sm text-purple p-4">Loading...</p>;
- if (!data) return <p className="text-sm text-purple p-4">Guide not found</p>;
+ if (loading) return <p className="text-sm text-purple p-4">{i18n.t('common.loading')}</p>;
+ if (!data) return <p className="text-sm text-purple p-4">{i18n.t('guideme.guideNotFound')}</p>;
const totalSteps = data.steps.length;
@@ -173,7 +171,7 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
<span className="flex-1 text-sm font-semibold text-foreground truncate">{data.guide.title}</span>
<span className="shrink-0 flex items-center gap-1.5 text-[11px] font-medium px-2 py-0.5 rounded-full bg-success/10 text-success">
<span className="w-1.5 h-1.5 rounded-full bg-success" />
- Live
+ {i18n.t('guideme.live')}
</span>
</div>
@@ -195,10 +193,10 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
<span className="w-5 h-5 rounded-full bg-accent text-white flex items-center justify-center text-[10px] font-bold">
{viewedStepIndex + 1}
</span>
- Step {viewedStepIndex + 1} of {totalSteps}
+ {i18n.t('guideme.stepOf', [String(viewedStepIndex + 1), String(totalSteps)])}
</span>
<p className="text-[15px] font-semibold text-foreground leading-snug">
- {viewedStep?.description || 'No description'}
+ {viewedStep?.description || i18n.t('guideme.noDescription')}
</p>
{viewedStep?.url && (
<span className="flex items-center gap-1.5 text-[11px] text-muted-foreground mt-1.5">
@@ -231,7 +229,7 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
className="flex items-center gap-1 text-xs font-medium text-purple hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed"
>
<ChevronLeft size={14} />
- Prev
+ {i18n.t('guideme.prev')}
</button>
<button
onClick={() => {
@@ -245,7 +243,9 @@ export default function GuideMeView({ guideId, onExit, onComplete }: GuideMeView
disabled={viewedStepIndex === totalSteps - 1 && viewedStepIndex !== activeStepIndex}
className="flex items-center gap-1 text-xs font-medium text-purple hover:text-foreground disabled:opacity-30 disabled:cursor-not-allowed"
>
- {viewedStepIndex === totalSteps - 1 && viewedStepIndex === activeStepIndex ? 'Finish' : 'Next'}
+ {viewedStepIndex === totalSteps - 1 && viewedStepIndex === activeStepIndex
+ ? i18n.t('guideme.finish')
+ : i18n.t('guideme.next')}
<ChevronRight size={14} />
</button>
</div>
diff --git a/src/ui/sidepanel/LibraryView.tsx b/src/ui/sidepanel/LibraryView.tsx
index 3ada343..b7bad5e 100644
--- a/src/ui/sidepanel/LibraryView.tsx
+++ b/src/ui/sidepanel/LibraryView.tsx
@@ -1,5 +1,6 @@
import { Star, Trash2 } from 'lucide-react';
import { useCallback, useEffect, useState } from 'react';
+import { i18n } from '#imports';
import {
type GuideChangeEvent,
getGuideDomain,
@@ -82,7 +83,7 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
: guides;
if (loading) {
- return <p className="text-sm py-4 text-purple">Loading...</p>;
+ return <p className="text-sm py-4 text-purple">{i18n.t('common.loading')}</p>;
}
if (guides.length === 0) {
@@ -124,8 +125,8 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
<path d="M106 126 Q112 118 118 126" stroke="#C7D2FE" strokeWidth="3" fill="none" strokeLinecap="round" />
<path d="M90 138 Q100 146 110 138" stroke="#C7D2FE" strokeWidth="2.5" fill="none" strokeLinecap="round" />
</svg>
- <p className="text-sm font-medium text-foreground mt-3">No guides yet</p>
- <p className="text-xs mt-1 text-purple">Start a capture to create your first guide</p>
+ <p className="text-sm font-medium text-foreground mt-3">{i18n.t('library.noGuidesTitle')}</p>
+ <p className="text-xs mt-1 text-purple">{i18n.t('library.noGuidesSub')}</p>
</div>
);
}
@@ -133,7 +134,7 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
if (filtered.length === 0) {
return (
<div className="py-8 text-center">
- <p className="text-sm text-purple">No matching guides</p>
+ <p className="text-sm text-purple">{i18n.t('library.noMatchingGuides')}</p>
</div>
);
}
@@ -161,7 +162,9 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
{guide.stepIds.length > 0 && (
<span className="text-[9px] font-semibold text-muted-foreground bg-secondary px-2 py-1 rounded-full shrink-0 leading-none mt-0.5">
- {guide.stepIds.length} step{guide.stepIds.length !== 1 ? 's' : ''}
+ {guide.stepIds.length !== 1
+ ? i18n.t('fullview.stepCountPlural', [String(guide.stepIds.length)])
+ : i18n.t('fullview.stepCount', [String(guide.stepIds.length)])}
</span>
)}
@@ -169,14 +172,14 @@ export default function LibraryView({ onOpen, searchQuery = '' }: LibraryViewPro
<button
onClick={(e) => handleStar(e, guide.id)}
className={`p-1.5 rounded-lg transition-all hover:text-accent ${guide.starred ? 'text-accent' : 'text-border'}`}
- title={guide.starred ? 'Unstar' : 'Star'}
+ title={guide.starred ? i18n.t('common.unstar') : i18n.t('common.star')}
>
<Star size={13} fill={guide.starred ? 'currentColor' : 'none'} />
</button>
<button
onClick={(e) => handleDelete(e, guide.id)}
className="p-1.5 rounded-lg transition-all text-border hover:text-destructive"
- title="Move to trash"
+ title={i18n.t('library.moveToTrash')}
>
<Trash2 size={13} />
</button>
diff --git a/src/ui/sidepanel/RecordingView.tsx b/src/ui/sidepanel/RecordingView.tsx
index 3be6b90..1e118c1 100644
--- a/src/ui/sidepanel/RecordingView.tsx
+++ b/src/ui/sidepanel/RecordingView.tsx
@@ -1,5 +1,6 @@
import { Check, EyeOff, X } from 'lucide-react';
import { useCallback, useEffect, useRef, useState } from 'react';
+import { i18n } from '#imports';
import { deleteStep, getScreenshotsForSteps, getStepsForGuide } from '@/core/guides/service';
import type { Screenshot, Step } from '@/core/guides/types';
import { getActiveTab } from '@/lib/browser-api';
@@ -15,9 +16,9 @@ interface RecordingViewProps {
function timeAgo(createdAt: number): string {
const diff = Math.floor((Date.now() - createdAt) / 1000);
- if (diff < 3) return 'Just now';
- if (diff < 60) return `${diff}s ago`;
- return `${Math.floor(diff / 60)}m ago`;
+ if (diff < 3) return i18n.t('recording.justNow');
+ if (diff < 60) return i18n.t('recording.secondsAgo', [String(diff)]);
+ return i18n.t('recording.minutesAgo', [String(Math.floor(diff / 60))]);
}
interface LiveStep {
@@ -104,7 +105,11 @@ export default function RecordingView({ guideId, onStop }: RecordingViewProps) {
<div className="absolute top-3 left-1/2 -translate-x-1/2 z-10 flex items-center gap-2 px-4 py-1.5 rounded-full bg-white/90 backdrop-blur-sm border border-border shadow-sm">
<span className={`w-2 h-2 rounded-full ${isBlurring ? 'bg-accent' : 'bg-destructive animate-pulse'}`} />
<span className="text-xs font-semibold text-foreground">
- {isBlurring ? 'Capture paused' : `Recording Β· ${steps.length} ${steps.length === 1 ? 'step' : 'steps'}`}
+ {isBlurring
+ ? i18n.t('recording.capturePaused')
+ : steps.length === 1
+ ? i18n.t('recording.recording', [String(steps.length)])
+ : i18n.t('recording.recordingPlural', [String(steps.length)])}
</span>
</div>
@@ -130,8 +135,8 @@ export default function RecordingView({ guideId, onStop }: RecordingViewProps) {
<ellipse cx="146" cy="64" rx="10" ry="8" fill="#1E1B4B" />
</svg>
<div className="text-center">
- <p className="text-sm font-semibold text-foreground">Ready to capture!</p>
- <p className="text-xs text-muted-foreground mt-0.5">Click on the page to start</p>
+ <p className="text-sm font-semibold text-foreground">{i18n.t('recording.readyTitle')}</p>
+ <p className="text-xs text-muted-foreground mt-0.5">{i18n.t('recording.readySub')}</p>
</div>
</div>
) : (
@@ -162,7 +167,7 @@ export default function RecordingView({ guideId, onStop }: RecordingViewProps) {
<button
onClick={() => handleDeleteStep(liveStep.step.id)}
className="opacity-0 group-hover:opacity-100 transition-opacity p-1 rounded text-border hover:text-destructive"
- title="Delete step"
+ title={i18n.t('recording.deleteStep')}
>
<X size={13} />
</button>
@@ -180,20 +185,20 @@ export default function RecordingView({ guideId, onStop }: RecordingViewProps) {
<div className="shrink-0 border-t border-border px-4 py-2.5 flex items-center gap-2">
<Button onClick={onStop} className="flex-1 h-10 rounded-full font-semibold text-[13px]">
<Check size={16} strokeWidth={3} />
- Finish Recording
+ {i18n.t('recording.finishRecording')}
</Button>
<button
onClick={handleBlur}
disabled={isBlurring}
className="w-10 h-10 rounded-full border border-border flex items-center justify-center transition-colors text-muted-foreground hover:border-accent hover:text-accent disabled:opacity-50 disabled:cursor-not-allowed"
- title="Smart Blur"
+ title={i18n.t('recording.smartBlur')}
>
<EyeOff size={16} />
</button>
<button
onClick={onStop}
className="w-10 h-10 rounded-full border border-border flex items-center justify-center transition-colors text-purple hover:border-destructive/30 hover:text-destructive"
- title="Discard"
+ title={i18n.t('recording.discard')}
>
<X size={16} />
</button>
diff --git a/src/ui/sidepanel/StepCard.tsx b/src/ui/sidepanel/StepCard.tsx
index 6cf6a2d..d418043 100644
--- a/src/ui/sidepanel/StepCard.tsx
+++ b/src/ui/sidepanel/StepCard.tsx
@@ -1,5 +1,6 @@
import { Check, Copy, EyeOff, Trash2 } from 'lucide-react';
import { useEffect, useState } from 'react';
+import { i18n } from '#imports';
import type { Screenshot, Step } from '@/core/guides/types';
import { logger } from '@/lib/logger';
import ZoomScreenshot from './ZoomScreenshot';
@@ -41,7 +42,7 @@ export default function StepCard({
};
const handleDelete = () => {
- if (window.confirm('Delete this step?')) onDelete(step.id);
+ if (window.confirm(i18n.t('editor.deleteThisStep'))) onDelete(step.id);
};
const handleCopy = async () => {
@@ -82,7 +83,7 @@ export default function StepCard({
/>
) : (
<div className="w-full h-32 flex items-center justify-center text-sm bg-secondary text-purple">
- No screenshot
+ {i18n.t('editor.noScreenshot')}
</div>
)}
@@ -106,14 +107,14 @@ export default function StepCard({
<button
onClick={() => onBlur?.(step.id)}
className="p-1 rounded-md transition-colors text-border hover:text-accent"
- title="Blur sensitive area"
+ title={i18n.t('editor.blurSensitiveArea')}
>
<EyeOff size={13} />
</button>
<button
onClick={handleCopy}
className={`p-1 rounded-md transition-colors ${copied ? 'text-success' : 'text-border hover:text-success'}`}
- title="Copy screenshot"
+ title={i18n.t('editor.copyScreenshot')}
>
{copied ? <Check size={13} /> : <Copy size={13} />}
</button>
@@ -122,7 +123,7 @@ export default function StepCard({
<button
onClick={handleDelete}
className="p-1 rounded-md transition-colors text-border hover:text-destructive"
- title="Delete step"
+ title={i18n.t('recording.deleteStep')}
>
<Trash2 size={13} />
</button>