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(desktop): translate the recording card, area editor and loading screen

Luis Ortiz5dfba9fcc290
diff --git a/apps/desktop/src/renderer/capture-host.ts b/apps/desktop/src/renderer/capture-host.ts
index 66ec658..a480c16 100644
--- a/apps/desktop/src/renderer/capture-host.ts
+++ b/apps/desktop/src/renderer/capture-host.ts
@@ -28,7 +28,7 @@ window.mimik.onRequest('mimik:capture:finishGuide', async (payload) => {
const guideId = payload as string;
const steps = await getStepsForGuide(guideId);
const app = steps.find((step) => step.app?.name)?.app?.name;
- await updateGuideTitle(guideId, app ? i18n.t('desktop.guideInApp', [app]) : i18n.t('desktop.newGuide'));
+ await updateGuideTitle(guideId, app ? i18n.t('desktop.guideInApp', [app]) : i18n.t('background.newGuide'));
const meta = await nameGuide(steps);
if (meta?.title) await updateGuideTitle(guideId, meta.title);
diff --git a/apps/desktop/src/renderer/overlay.ts b/apps/desktop/src/renderer/overlay.ts
index 287b293..6c93d75 100644
--- a/apps/desktop/src/renderer/overlay.ts
+++ b/apps/desktop/src/renderer/overlay.ts
@@ -1,3 +1,4 @@
+import './core-env';
import './overlay.css';
import { boundary } from './overlay/boundary';
import { controls } from './overlay/controls';
diff --git a/apps/desktop/src/renderer/overlay/controls.ts b/apps/desktop/src/renderer/overlay/controls.ts
index 3a18959..5c99982 100644
--- a/apps/desktop/src/renderer/overlay/controls.ts
+++ b/apps/desktop/src/renderer/overlay/controls.ts
@@ -1,12 +1,13 @@
+import { i18n } from '@mimik/core/env';
import type { OverlayView } from '../../main/overlay';
import { icon } from '../icons';
import { cameraMascot } from './camera-mascot';
import { el } from './el';
const MODES = [
- { id: 'window', label: 'Window', glyph: 'window' },
- { id: 'screen', label: 'Screen', glyph: 'monitor' },
- { id: 'area', label: 'Area', glyph: 'area' },
+ { id: 'window', label: 'desktop_modeWindow', glyph: 'window' },
+ { id: 'screen', label: 'desktop_modeScreen', glyph: 'monitor' },
+ { id: 'area', label: 'desktop_modeRegion', glyph: 'area' },
] as const;
const MODE_COMMAND: Record<string, string> = {
@@ -36,20 +37,20 @@ export function controls(): void {
const veilMascot = el('div', { id: 'veilMascot' }, cameraMascot(56));
const veilPause = el('span', { id: 'veilPause' }, icon('pause', 16));
const veil = el('div', { id: 'veil' }, veilMascot, veilPause, veilText);
- const remove = el('button', { id: 'remove', type: 'button', title: 'Remove this step' });
- remove.setAttribute('aria-label', 'Remove this step');
+ const remove = el('button', { id: 'remove', type: 'button', title: i18n.t('recording_deleteStep') });
+ remove.setAttribute('aria-label', i18n.t('recording_deleteStep'));
remove.append(icon('trash', 13));
const preview = el('div', { id: 'preview' }, shot, veil, remove);
const stepTitle = el('p', { id: 'stepTitle' });
- const writing = el('p', { id: 'writing' }, icon('loader', 13), 'Writing step description…');
+ const writing = el('p', { id: 'writing' }, icon('loader', 13), i18n.t('editor_writingStepDescription'));
const skeleton = el(
'div',
{ id: 'skeleton' },
el('p', { className: 'line' }, el('span', {}), '\u00a0'),
el('div', { className: 'meta' }, el('span', {}), '\u00a0'),
);
- const source = el('span', { id: 'source' });
+ const source = el('span', { id: 'source', title: i18n.t('stepSource_hint') });
const metaText = el('span', { id: 'metaText' });
const stepMeta = el('div', { id: 'stepMeta' }, source, metaText);
@@ -65,10 +66,10 @@ export function controls(): void {
const intro = el('div', { id: 'intro' }, el('div', { id: 'mascot' }, cameraMascot(56)), tip);
const body = el('div', { id: 'body' }, preview, stepTitle, writing, skeleton, stepMeta, intro, hint);
- const modeLabel = el('p', { id: 'modeLabel' }, 'Capture mode');
+ const modeLabel = el('p', { id: 'modeLabel' }, i18n.t('desktop_captureMode'));
const modeRow = el('div', { id: 'modes' });
const modeButtons = MODES.map(({ id, label: text, glyph }) => {
- const button = el('button', { type: 'button', className: 'mode' }, icon(glyph, 13), text);
+ const button = el('button', { type: 'button', className: 'mode' }, icon(glyph, 13), i18n.t(text));
button.dataset.mode = id;
button.addEventListener('click', () => window.mimikOverlay.command(MODE_COMMAND[id]));
modeRow.append(button);
@@ -103,16 +104,23 @@ export function controls(): void {
document.body.classList.toggle('resting', resting);
document.body.classList.toggle('busy', busy);
- label.textContent = starting ? 'Starting…' : recording ? 'Recording' : paused ? 'Paused' : 'Ready';
const count = step?.index ?? 0;
- counter.textContent = `${count} ${count === 1 ? 'step' : 'steps'}`;
- counter.hidden = armed;
+ const counted = [String(count)];
+ label.textContent = starting
+ ? 'Starting…'
+ : recording
+ ? i18n.t(count === 1 ? 'recording_recording' : 'recording_recordingPlural', counted)
+ : paused
+ ? i18n.t('recording_capturePaused')
+ : i18n.t('desktop_ready');
+ counter.textContent = i18n.t(count === 1 ? 'fullview_stepCount' : 'fullview_stepCountPlural', counted);
+ counter.hidden = !paused;
const modeId = MODE_ID[mode] ?? 'window';
if (modeId !== shownMode) {
shownMode = modeId;
const shown = MODES.find((candidate) => candidate.id === modeId) ?? MODES[0];
- badge.replaceChildren(icon(shown.glyph, 12), shown.label);
+ badge.replaceChildren(icon(shown.glyph, 12), i18n.t(shown.label));
}
badge.hidden = paused || collapsed;
pillWriting.hidden = !(collapsed && pending);
@@ -143,9 +151,11 @@ export function controls(): void {
skeleton.hidden = !busy;
stepMeta.hidden = !settled;
source.hidden = pending;
- source.textContent = step?.source === 'ai' ? 'AI' : 'Basic';
+ source.textContent = i18n.t(step?.source === 'ai' ? 'stepSource_ai' : 'stepSource_basic');
source.className = step?.source === 'ai' ? 'ai' : 'basic';
- metaText.textContent = [step ? `Step ${step.index}` : '', step?.app ?? ''].filter(Boolean).join(' · ');
+ metaText.textContent = [step ? i18n.t('export_stepLabel', [String(step.index)]) : '', step?.app ?? '']
+ .filter(Boolean)
+ .join(' · ');
intro.hidden = !(armed || waiting || resting);
tip.textContent = armed
@@ -166,9 +176,9 @@ export function controls(): void {
shownIcon = state;
secondary.replaceChildren();
if (!armed) secondary.append(icon(recording ? 'pause' : 'play'));
- secondary.append(armed ? 'Close' : recording ? 'Pause' : 'Resume');
+ secondary.append(i18n.t(armed ? 'common_close' : recording ? 'desktop_pause' : 'desktop_resume'));
primary.replaceChildren(icon(armed ? 'video' : 'check'));
- primary.append(armed ? 'Start' : 'Finish');
+ primary.append(i18n.t(armed ? 'desktop_startButton' : 'desktop_finish'));
}
secondary.dataset.command = armed ? 'cancel' : recording ? 'pause' : 'resume';
primary.dataset.command = armed ? 'start' : 'stop';
diff --git a/apps/desktop/src/renderer/overlay/editor.ts b/apps/desktop/src/renderer/overlay/editor.ts
index 5d1852e..567a7d4 100644
--- a/apps/desktop/src/renderer/overlay/editor.ts
+++ b/apps/desktop/src/renderer/overlay/editor.ts
@@ -1,3 +1,4 @@
+import { i18n } from '@mimik/core/env';
import { icon } from '../icons';
import { el } from './el';
import type { Region } from './types';
@@ -28,12 +29,17 @@ export function editor(origin: { x: number; y: number }): void {
region.append(node);
}
- const cancel = el('button', { type: 'button', className: 'secondary' }, 'Cancel', el('kbd', {}, 'Esc'));
+ const cancel = el(
+ 'button',
+ { type: 'button', className: 'secondary' },
+ i18n.t('common_cancel'),
+ el('kbd', {}, 'Esc'),
+ );
const done = el(
'button',
{ type: 'button', className: 'primary' },
icon('check', 15),
- 'Done',
+ i18n.t('annotationEditor_done'),
el('kbd', {}, 'Enter'),
);
cancel.addEventListener('click', () => window.mimikOverlay.command('cancel'));
diff --git a/apps/desktop/src/renderer/splash.ts b/apps/desktop/src/renderer/splash.ts
index 9366cac..0a7bace 100644
--- a/apps/desktop/src/renderer/splash.ts
+++ b/apps/desktop/src/renderer/splash.ts
@@ -1,3 +1,5 @@
+import './core-env';
+import { i18n } from '@mimik/core/env';
import './splash.css';
import { el } from './overlay/el';
import { mascot } from './overlay/mascot';
@@ -8,6 +10,6 @@ document.body.append(
{ id: 'splash' },
el('div', { id: 'mascot' }, mascot(116)),
el('p', { id: 'wordmark' }, 'Mimik'),
- el('div', { id: 'meter', role: 'progressbar', ariaLabel: 'Loading' }, el('span', {})),
+ el('div', { id: 'meter', role: 'progressbar', ariaLabel: i18n.t('common_loading') }, el('span', {})),
),
);
diff --git a/src/locales/de.yml b/src/locales/de.yml
index 977e112..7fc6342 100644
--- a/src/locales/de.yml
+++ b/src/locales/de.yml
@@ -153,32 +153,22 @@ blurPresets:
macAddress: MAC-Adresse
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
- ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
- pause: Pause
- resume: Resume
- finish: Finish
+ ready: "Bereit"
+ pause: "Pausieren"
+ resume: "Fortsetzen"
+ finish: "Beenden"
showCursor: Show the cursor in screenshots
- screenshotDelay: Screenshot delay
- keepClicksBeyondArea: Capture clicks outside the capture area
- guideInApp: "Guide in $1"
- newGuide: New Guide
- capturingSection: Capturing
+ screenshotDelay: "Screenshot-Verzögerung"
+ keepClicksBeyondArea: "Klicks außerhalb des Bereichs aufnehmen"
+ guideInApp: "Anleitung in $1"
+ capturingSection: "Aufnahme"
milliseconds: ms
captureMode: Was aufnehmen
modeWindow: Fenster
modeScreen: Bildschirm
modeRegion: Bereich
- readyToRecord: Bereit zur Aufnahme
startSheetTitle: Aufnahme starten
startButton: Starten
- guideCount: $1 Anleitung
- guideCountPlural: $1 Anleitungen
shortcutsSection: "Tastenkürzel"
cardScreenshots: "Screenshots"
cardKeyboard: "Tippen und Tasten"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "Jetzt einen Schritt aufnehmen"
shortcutPress: "Tasten drücken…"
shortcutClear: "Löschen"
- shortcutTaken: "Eine andere Anwendung nutzt diese Taste bereits"
fullview:
allGuides: Alle Anleitungen
diff --git a/src/locales/en.yml b/src/locales/en.yml
index e0645dc..f743f2d 100644
--- a/src/locales/en.yml
+++ b/src/locales/en.yml
@@ -153,13 +153,7 @@ blurPresets:
macAddress: MAC Address
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
pause: Pause
resume: Resume
finish: Finish
@@ -167,18 +161,14 @@ desktop:
screenshotDelay: Screenshot delay
keepClicksBeyondArea: Capture clicks outside the area
guideInApp: "Guide in $1"
- newGuide: New Guide
capturingSection: Capturing
milliseconds: ms
captureMode: What to capture
modeWindow: Window
modeScreen: Screen
modeRegion: Area
- readyToRecord: Ready to record
startSheetTitle: Start a capture
startButton: Start
- guideCount: $1 guide
- guideCountPlural: $1 guides
shortcutsSection: "Shortcuts"
cardScreenshots: "Screenshots"
cardKeyboard: "Typing and keys"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "Capture a step now"
shortcutPress: "Press keys…"
shortcutClear: "Clear"
- shortcutTaken: "Another application already owns this key"
fullview:
allGuides: All Guides
diff --git a/src/locales/es.yml b/src/locales/es.yml
index d2716d5..194c843 100644
--- a/src/locales/es.yml
+++ b/src/locales/es.yml
@@ -153,32 +153,22 @@ blurPresets:
macAddress: "Dirección MAC"
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
- ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
- pause: Pause
- resume: Resume
- finish: Finish
+ ready: "Listo"
+ pause: "Pausar"
+ resume: "Reanudar"
+ finish: "Finalizar"
showCursor: Show the cursor in screenshots
- screenshotDelay: Screenshot delay
- keepClicksBeyondArea: Capture clicks outside the capture area
- guideInApp: "Guide in $1"
- newGuide: New Guide
- capturingSection: Capturing
+ screenshotDelay: "Retraso de la captura"
+ keepClicksBeyondArea: "Capturar clics fuera del área"
+ guideInApp: "Guía en $1"
+ capturingSection: "Captura"
milliseconds: ms
captureMode: Qué capturar
modeWindow: Ventana
modeScreen: Pantalla
modeRegion: Área
- readyToRecord: Listo para grabar
startSheetTitle: Iniciar una captura
startButton: Iniciar
- guideCount: $1 guía
- guideCountPlural: $1 guías
shortcutsSection: "Atajos"
cardScreenshots: "Capturas de pantalla"
cardKeyboard: "Escritura y teclas"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "Capturar un paso ahora"
shortcutPress: "Pulsa las teclas…"
shortcutClear: "Borrar"
- shortcutTaken: "Otra aplicación ya usa esta tecla"
fullview:
allGuides: Todas las guías
diff --git a/src/locales/fr.yml b/src/locales/fr.yml
index 54660db..b7c7501 100644
--- a/src/locales/fr.yml
+++ b/src/locales/fr.yml
@@ -153,32 +153,22 @@ blurPresets:
macAddress: Adresse MAC
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
- ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
- pause: Pause
- resume: Resume
- finish: Finish
+ ready: "Prêt"
+ pause: "Pause"
+ resume: "Reprendre"
+ finish: "Terminer"
showCursor: Show the cursor in screenshots
- screenshotDelay: Screenshot delay
- keepClicksBeyondArea: Capture clicks outside the capture area
- guideInApp: "Guide in $1"
- newGuide: New Guide
- capturingSection: Capturing
+ screenshotDelay: "Délai de capture"
+ keepClicksBeyondArea: "Capturer les clics hors de la zone"
+ guideInApp: "Guide dans $1"
+ capturingSection: "Capture"
milliseconds: ms
captureMode: Quoi capturer
modeWindow: Fenêtre
modeScreen: Écran
modeRegion: Zone
- readyToRecord: Prêt à enregistrer
startSheetTitle: Démarrer une capture
startButton: Démarrer
- guideCount: $1 guide
- guideCountPlural: $1 guides
shortcutsSection: "Raccourcis"
cardScreenshots: "Captures d’écran"
cardKeyboard: "Saisie et touches"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "Capturer une étape maintenant"
shortcutPress: "Appuyez sur les touches…"
shortcutClear: "Effacer"
- shortcutTaken: "Une autre application utilise déjà cette touche"
fullview:
allGuides: Tous les guides
diff --git a/src/locales/pt-BR.yml b/src/locales/pt-BR.yml
index 9fe06d0..2d685c1 100644
--- a/src/locales/pt-BR.yml
+++ b/src/locales/pt-BR.yml
@@ -153,32 +153,22 @@ blurPresets:
macAddress: Endereço MAC
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
- ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
- pause: Pause
- resume: Resume
- finish: Finish
+ ready: "Pronto"
+ pause: "Pausar"
+ resume: "Retomar"
+ finish: "Concluir"
showCursor: Show the cursor in screenshots
- screenshotDelay: Screenshot delay
- keepClicksBeyondArea: Capture clicks outside the capture area
- guideInApp: "Guide in $1"
- newGuide: New Guide
- capturingSection: Capturing
+ screenshotDelay: "Atraso da captura"
+ keepClicksBeyondArea: "Capturar cliques fora da área"
+ guideInApp: "Guia no $1"
+ capturingSection: "Captura"
milliseconds: ms
captureMode: O que capturar
modeWindow: Janela
modeScreen: Tela
modeRegion: Área
- readyToRecord: Pronto para gravar
startSheetTitle: Iniciar uma captura
startButton: Iniciar
- guideCount: $1 guia
- guideCountPlural: $1 guias
shortcutsSection: "Atalhos"
cardScreenshots: "Capturas de tela"
cardKeyboard: "Digitação e teclas"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "Capturar uma etapa agora"
shortcutPress: "Pressione as teclas…"
shortcutClear: "Limpar"
- shortcutTaken: "Outro aplicativo já usa esta tecla"
fullview:
allGuides: Todos os guias
diff --git a/src/locales/zh-CN.yml b/src/locales/zh-CN.yml
index 8f45764..b43ec28 100644
--- a/src/locales/zh-CN.yml
+++ b/src/locales/zh-CN.yml
@@ -153,32 +153,22 @@ blurPresets:
macAddress: MAC 地址
desktop:
- record: Record
- captureArea: Capture area
- capturing: Capturing
- paused: Paused
- ready: Ready
- lastStep: Last step
- noStepsYet: No steps captured yet
- pause: Pause
- resume: Resume
- finish: Finish
+ ready: "就绪"
+ pause: "暂停"
+ resume: "继续"
+ finish: "完成"
showCursor: Show the cursor in screenshots
- screenshotDelay: Screenshot delay
- keepClicksBeyondArea: Capture clicks outside the capture area
- guideInApp: "Guide in $1"
- newGuide: New Guide
- capturingSection: Capturing
+ screenshotDelay: "截图延迟"
+ keepClicksBeyondArea: "捕获区域外的点击"
+ guideInApp: "$1 中的指南"
+ capturingSection: "捕获"
milliseconds: ms
captureMode: 捕获范围
modeWindow: 窗口
modeScreen: 屏幕
modeRegion: 区域
- readyToRecord: 可以开始录制
startSheetTitle: 开始捕获
startButton: 开始
- guideCount: $1 个指南
- guideCountPlural: $1 个指南
shortcutsSection: "快捷键"
cardScreenshots: "屏幕截图"
cardKeyboard: "输入与按键"
@@ -211,7 +201,6 @@ desktop:
shortcutCapture: "立即捕获一步"
shortcutPress: "请按下按键…"
shortcutClear: "清除"
- shortcutTaken: "其他应用已占用该按键"
fullview:
allGuides: 全部指南