Skip to content

Voice-to-text dictation app with local (Nvidia Parakeet/Whisper) and cloud models (BYOK). Privacy-first and available cross-platform.

fix(i18n): repair two unresolvable translation keys and guard against regressions (#1592)

Gabriel Stein548de3d9efb8
diff --git a/src/components/onboarding/MeetingSetupStep.tsx b/src/components/onboarding/MeetingSetupStep.tsx
index 0a83c99f8..b4bf68b1b 100644
--- a/src/components/onboarding/MeetingSetupStep.tsx
+++ b/src/components/onboarding/MeetingSetupStep.tsx
@@ -94,7 +94,7 @@ export default function MeetingSetupStep({
disabled={isRegistering}
className="mt-2 text-xs text-muted-foreground/70 hover:text-foreground transition-colors disabled:opacity-50"
>
- {t("settingsPage.general.meetingHotkey.clear")}
+ {t("hotkeyInput.remove")}
</button>
)}
</div>
diff --git a/src/components/settings/MeetingSettings.tsx b/src/components/settings/MeetingSettings.tsx
index af6d02def..364f6cdad 100644
--- a/src/components/settings/MeetingSettings.tsx
+++ b/src/components/settings/MeetingSettings.tsx
@@ -87,7 +87,7 @@ export function MeetingTranscriptionPanel() {
description: t("settingsPage.transcription.modes.selfHostedDesc"),
icon: <Network className="w-4 h-4" />,
disabled: true,
- badge: t("settings.meeting.comingSoon"),
+ badge: t("common.comingSoon"),
},
],
"transcription",
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index 54f1cc124..4c21c02f5 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -148,6 +148,7 @@
"active": "Aktiv",
"managedByOrg": "Von Ihrer Organisation verwaltet",
"freeAccountRequired": "Kostenloses Konto erforderlich",
+ "comingSoon": "Demnächst verfügbar",
"cloud": "Cloud",
"local": "Lokal",
"apiKey": "API-Schlüssel",
@@ -2827,7 +2828,6 @@
"meeting": {
"title": "Besprechungsnotizen",
"description": "Transkriptionen und strukturierte Zusammenfassungen",
- "comingSoon": "Demnächst verfügbar",
"back": "Zurück",
"restrictedByOrg": "Die Transkription von Besprechungen ist durch Ihre Organisation eingeschränkt."
},
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 0b5f1cef4..c04b7c337 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -148,6 +148,7 @@
"active": "Active",
"managedByOrg": "Managed by your organization",
"freeAccountRequired": "Free account required",
+ "comingSoon": "Coming Soon",
"cloud": "Cloud",
"local": "Local",
"apiKey": "API Key",
@@ -2827,7 +2828,6 @@
"meeting": {
"title": "Meeting Notes",
"description": "Transcriptions & structured summaries",
- "comingSoon": "Coming Soon",
"back": "Back",
"restrictedByOrg": "Meeting transcription is restricted by your organization."
},
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 1fabefafe..730048fbb 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -148,6 +148,7 @@
"active": "Activo",
"managedByOrg": "Gestionado por tu organización",
"freeAccountRequired": "Cuenta gratuita requerida",
+ "comingSoon": "Próximamente",
"cloud": "Nube",
"local": "Local",
"apiKey": "Clave API",
@@ -2667,7 +2668,6 @@
"meeting": {
"title": "Notas de reunión",
"description": "Transcripciones y resúmenes estructurados",
- "comingSoon": "Próximamente",
"back": "Atrás",
"restrictedByOrg": "La transcripción de reuniones está restringida por tu organización."
},
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index d24b4b2f0..5d8fcaef4 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -148,6 +148,7 @@
"active": "Actif",
"managedByOrg": "Géré par votre organisation",
"freeAccountRequired": "Compte gratuit requis",
+ "comingSoon": "Bientôt disponible",
"cloud": "Cloud",
"local": "Local",
"apiKey": "Clé API",
@@ -2827,7 +2828,6 @@
"meeting": {
"title": "Notes de réunion",
"description": "Transcriptions et résumés structurés",
- "comingSoon": "Bientôt disponible",
"back": "Retour",
"restrictedByOrg": "La transcription des réunions est restreinte par votre organisation."
},
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index b73c0b858..78e5159b1 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -148,6 +148,7 @@
"active": "Attivo",
"managedByOrg": "Gestito dalla tua organizzazione",
"freeAccountRequired": "Account gratuito richiesto",
+ "comingSoon": "Prossimamente",
"cloud": "Cloud",
"local": "Locale",
"apiKey": "Chiave API",
@@ -2619,7 +2620,6 @@
"meeting": {
"title": "Note delle riunioni",
"description": "Trascrizioni e riassunti strutturati",
- "comingSoon": "Prossimamente",
"back": "Indietro",
"restrictedByOrg": "La trascrizione delle riunioni è limitata dalla tua organizzazione."
},
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 9a240fe58..da7ec3118 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -148,6 +148,7 @@
"active": "有効",
"managedByOrg": "組織によって管理されています",
"freeAccountRequired": "無料アカウントが必要です",
+ "comingSoon": "近日公開",
"cloud": "クラウド",
"local": "ローカル",
"apiKey": "API キー",
@@ -2603,7 +2604,6 @@
"meeting": {
"title": "議事録",
"description": "文字起こしと構造化されたサマリー",
- "comingSoon": "近日公開",
"back": "戻る",
"restrictedByOrg": "会議の文字起こしは組織によって制限されています。"
},
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index def7b2994..9aebae2b5 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -127,6 +127,7 @@
"active": "Ativo",
"managedByOrg": "Gerenciado pela sua organização",
"freeAccountRequired": "Conta gratuita necessária",
+ "comingSoon": "Em breve",
"cloud": "Nuvem",
"local": "Local",
"apiKey": "Chave API",
@@ -2619,7 +2620,6 @@
"meeting": {
"title": "Notas de reunião",
"description": "Transcrições e resumos estruturados",
- "comingSoon": "Em breve",
"back": "Voltar",
"restrictedByOrg": "A transcrição de reuniões está restrita pela sua organização."
},
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index 62285795c..5495cac81 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -148,6 +148,7 @@
"active": "Активно",
"managedByOrg": "Управляется вашей организацией",
"freeAccountRequired": "Требуется бесплатный аккаунт",
+ "comingSoon": "Скоро",
"cloud": "Облако",
"local": "Локально",
"apiKey": "API-ключ",
@@ -2639,7 +2640,6 @@
"meeting": {
"title": "Заметки со встреч",
"description": "Транскрипции и структурированные резюме",
- "comingSoon": "Скоро",
"back": "Назад",
"restrictedByOrg": "Транскрипция встреч ограничена вашей организацией."
},
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index d55c98853..a5becd859 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -148,6 +148,7 @@
"active": "已激活",
"managedByOrg": "由您的组织管理",
"freeAccountRequired": "需要免费账户",
+ "comingSoon": "即将推出",
"cloud": "云端",
"local": "本地",
"apiKey": "API Key",
@@ -2619,7 +2620,6 @@
"meeting": {
"title": "会议笔记",
"description": "转录与结构化摘要",
- "comingSoon": "即将推出",
"back": "返回",
"restrictedByOrg": "会议转录已被您的组织限制。"
},
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 45e6f5953..7627c5577 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -148,6 +148,7 @@
"active": "使用中",
"managedByOrg": "由您的組織管理",
"freeAccountRequired": "需要免費帳戶",
+ "comingSoon": "即將推出",
"cloud": "雲端",
"local": "本機",
"apiKey": "API Key",
@@ -2619,7 +2620,6 @@
"meeting": {
"title": "會議筆記",
"description": "轉錄與結構化摘要",
- "comingSoon": "即將推出",
"back": "返回",
"restrictedByOrg": "會議轉錄已被您的組織限制。"
},
diff --git a/test/locales/translationCoverage.test.js b/test/locales/translationCoverage.test.js
new file mode 100644
index 000000000..0ac30cd08
--- /dev/null
+++ b/test/locales/translationCoverage.test.js
@@ -0,0 +1,113 @@
+const test = require("node:test");
+const assert = require("node:assert/strict");
+const fs = require("node:fs");
+const path = require("node:path");
+
+const SRC = path.join(__dirname, "../../src");
+const LOCALES = path.join(SRC, "locales");
+const NAMESPACES = ["translation", "prompts"];
+const PLURAL_SUFFIX = /_(zero|one|two|few|many|other)$/;
+const T_CALL = /\bt\(\s*(['"`])([A-Za-z0-9_.-]+)\1/g;
+const INTERPOLATION = /\{\{\s*([\w.]+)/g;
+
+const languages = fs
+ .readdirSync(LOCALES)
+ .filter((entry) => fs.statSync(path.join(LOCALES, entry)).isDirectory());
+
+const load = (lang, namespace) =>
+ JSON.parse(fs.readFileSync(path.join(LOCALES, lang, `${namespace}.json`), "utf8"));
+
+function flatten(value, prefix = "", out = new Map()) {
+ if (value && typeof value === "object" && !Array.isArray(value)) {
+ for (const [key, child] of Object.entries(value)) {
+ flatten(child, prefix ? `${prefix}.${key}` : key, out);
+ }
+ } else {
+ out.set(prefix, value);
+ }
+ return out;
+}
+
+function sourceFiles(dir, out = []) {
+ for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
+ const full = path.join(dir, entry.name);
+ if (entry.isDirectory()) {
+ if (entry.name !== "locales" && entry.name !== "dist") sourceFiles(full, out);
+ } else if (/\.(ts|tsx|js|jsx)$/.test(entry.name)) {
+ out.push(full);
+ }
+ }
+ return out;
+}
+
+const stripPlural = (key) => key.replace(PLURAL_SUFFIX, "");
+
+test("every t() key referenced in source resolves in en", () => {
+ const keys = new Set();
+ for (const namespace of NAMESPACES) {
+ for (const key of flatten(load("en", namespace)).keys()) keys.add(key);
+ }
+ // i18next also resolves a plural base and a parent path returned as an object.
+ const bases = new Set([...keys].map(stripPlural));
+ const parents = new Set();
+ for (const key of keys) {
+ const parts = key.split(".");
+ for (let i = 1; i < parts.length; i += 1) parents.add(parts.slice(0, i).join("."));
+ }
+
+ const broken = [];
+ for (const file of sourceFiles(SRC)) {
+ const source = fs.readFileSync(file, "utf8");
+ for (const match of source.matchAll(T_CALL)) {
+ const key = match[2];
+ if (!key.includes(".")) continue;
+ if (keys.has(key) || bases.has(key) || parents.has(key)) continue;
+ broken.push(
+ `${path.relative(SRC, file)}:${source.slice(0, match.index).split("\n").length} → ${key}`
+ );
+ }
+ }
+
+ assert.deepEqual(broken, [], `Missing en translations:\n${broken.join("\n")}`);
+});
+
+test("every en key is present in every other language", () => {
+ for (const namespace of NAMESPACES) {
+ const en = flatten(load("en", namespace));
+ for (const lang of languages) {
+ if (lang === "en") continue;
+ const translated = flatten(load(lang, namespace));
+ // Plural categories are language specific (ru adds _few/_many, zh only has
+ // _other), so a matching plural base counts as covered.
+ const bases = new Set([...translated.keys()].map(stripPlural));
+ const gaps = [...en.keys()].filter(
+ (key) => !translated.has(key) && !bases.has(stripPlural(key))
+ );
+ assert.deepEqual(gaps, [], `${lang}/${namespace} is missing:\n${gaps.join("\n")}`);
+ }
+ }
+});
+
+test("interpolation variables match en in every language", () => {
+ // Compares names, not repeat counts — word order can make a translation
+ // reference the same variable a different number of times.
+ const variables = (value) =>
+ typeof value === "string"
+ ? [...new Set([...value.matchAll(INTERPOLATION)].map((m) => m[1]))].sort()
+ : [];
+
+ for (const namespace of NAMESPACES) {
+ const en = flatten(load("en", namespace));
+ for (const lang of languages) {
+ if (lang === "en") continue;
+ for (const [key, value] of flatten(load(lang, namespace))) {
+ if (!en.has(key)) continue;
+ assert.deepEqual(
+ variables(value),
+ variables(en.get(key)),
+ `${lang}/${namespace} ${key} has different {{variables}} than en`
+ );
+ }
+ }
+ }
+});