Skip to content

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

fix: use i18n for hotkey fallback toast and add missing error logging

Gabriel Steinb85305aea3f2
diff --git a/src/App.jsx b/src/App.jsx
index 6030b238e..79ea35bc5 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -108,7 +108,7 @@ export default function App() {
const unsubscribeFallback = window.electronAPI?.onHotkeyFallbackUsed?.((data) => {
toast({
title: t("app.toasts.hotkeyChanged.title"),
- description: data.message,
+ description: t("app.toasts.hotkeyChanged.description", { original: data.original, fallback: data.fallback }),
duration: 8000,
});
});
diff --git a/src/components/SettingsPage.tsx b/src/components/SettingsPage.tsx
index 213b6725a..e456bac8f 100644
--- a/src/components/SettingsPage.tsx
+++ b/src/components/SettingsPage.tsx
@@ -1100,7 +1100,9 @@ export default function SettingsPage({ activeSection = "general" }: SettingsPage
try {
const key = await window.electronAPI?.getEffectiveDefaultHotkey?.();
if (key) setEffectiveDefaultHotkey(key);
- } catch {}
+ } catch (error) {
+ logger.error("Failed to get effective default hotkey", error, "settings");
+ }
};
checkHotkeyMode();
}, [setActivationMode]);
diff --git a/src/helpers/hotkeyManager.js b/src/helpers/hotkeyManager.js
index 9670969d3..fad383356 100644
--- a/src/helpers/hotkeyManager.js
+++ b/src/helpers/hotkeyManager.js
@@ -187,7 +187,7 @@ class HotkeyManager {
);
return {
success: false,
- error: `Failed to register GNOME hotkey "${hotkey}" for ${slotName}`,
+ error: i18nMain.t("hotkey.errors.registrationFailed", { hotkey }),
};
}
@@ -859,7 +859,9 @@ class HotkeyManager {
`localStorage.getItem("dictationKey") || ""`
);
if (lsKey && lsKey.trim() !== "") return lsKey;
- } catch {}
+ } catch (err) {
+ debugLogger.log("[HotkeyManager] Failed to read dictationKey from localStorage:", err.message);
+ }
}
try {
@@ -867,7 +869,9 @@ class HotkeyManager {
const envManager = new EnvironmentManager();
const envKey = envManager.getDictationKey();
if (envKey && envKey.trim() !== "") return envKey;
- } catch {}
+ } catch (err) {
+ debugLogger.log("[HotkeyManager] Failed to read dictationKey from .env:", err.message);
+ }
return DEFAULT_HOTKEY;
}
diff --git a/src/helpers/ipcHandlers.js b/src/helpers/ipcHandlers.js
index 6a0c2a0c4..de4949c15 100644
--- a/src/helpers/ipcHandlers.js
+++ b/src/helpers/ipcHandlers.js
@@ -1680,7 +1680,7 @@ class IPCHandlers {
}
}
- // On GNOME Wayland, re-register the keybinding with the effective hotkey
+ // On GNOME, re-register the keybinding with the effective hotkey
if (hotkeyManager.isUsingGnome() && hotkeyManager.gnomeManager && effectiveHotkey) {
const gnomeHotkey = GnomeShortcutManager.convertToGnomeFormat(effectiveHotkey);
debugLogger.log(
diff --git a/src/locales/de/translation.json b/src/locales/de/translation.json
index af3dd25ce..0ba581634 100644
--- a/src/locales/de/translation.json
+++ b/src/locales/de/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Tastenkombination geändert"
+ "title": "Tastenkombination geändert",
+ "description": "\"{{original}}\" war nicht verfügbar. Stattdessen wird \"{{fallback}}\" verwendet. Du kannst dies in den Einstellungen ändern."
},
"hotkeyUnavailable": {
"title": "Tastenkombination nicht verfügbar",
diff --git a/src/locales/en/translation.json b/src/locales/en/translation.json
index 3c4727925..6b182ec77 100644
--- a/src/locales/en/translation.json
+++ b/src/locales/en/translation.json
@@ -1899,7 +1899,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Hotkey changed"
+ "title": "Hotkey changed",
+ "description": "\"{{original}}\" was unavailable. Using \"{{fallback}}\" instead. You can change this in Settings."
},
"hotkeyUnavailable": {
"title": "Hotkey unavailable",
diff --git a/src/locales/es/translation.json b/src/locales/es/translation.json
index 4936e700d..cc9f20e9e 100644
--- a/src/locales/es/translation.json
+++ b/src/locales/es/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Atajo cambiado"
+ "title": "Atajo cambiado",
+ "description": "\"{{original}}\" no estaba disponible. Se usará \"{{fallback}}\" en su lugar. Puedes cambiarlo en Configuración."
},
"hotkeyUnavailable": {
"title": "Atajo no disponible",
diff --git a/src/locales/fr/translation.json b/src/locales/fr/translation.json
index ac6397a6d..5ef220b6d 100644
--- a/src/locales/fr/translation.json
+++ b/src/locales/fr/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Raccourci modifié"
+ "title": "Raccourci modifié",
+ "description": "\"{{original}}\" n'était pas disponible. \"{{fallback}}\" sera utilisé à la place. Vous pouvez le modifier dans les Paramètres."
},
"hotkeyUnavailable": {
"title": "Raccourci indisponible",
diff --git a/src/locales/it/translation.json b/src/locales/it/translation.json
index b75496318..fb14675ea 100644
--- a/src/locales/it/translation.json
+++ b/src/locales/it/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Scorciatoia modificata"
+ "title": "Scorciatoia modificata",
+ "description": "\"{{original}}\" non era disponibile. Verrà usato \"{{fallback}}\" al suo posto. Puoi modificarlo nelle Impostazioni."
},
"hotkeyUnavailable": {
"title": "Scorciatoia non disponibile",
diff --git a/src/locales/ja/translation.json b/src/locales/ja/translation.json
index 9a59b864d..bf8546528 100644
--- a/src/locales/ja/translation.json
+++ b/src/locales/ja/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "ホットキーが変更されました"
+ "title": "ホットキーが変更されました",
+ "description": "\"{{original}}\" が使用できませんでした。代わりに \"{{fallback}}\" を使用します。設定で変更できます。"
},
"hotkeyUnavailable": {
"title": "ホットキーが使用できません",
diff --git a/src/locales/pt/translation.json b/src/locales/pt/translation.json
index 8010a616c..979dd08b0 100644
--- a/src/locales/pt/translation.json
+++ b/src/locales/pt/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Atalho alterado"
+ "title": "Atalho alterado",
+ "description": "\"{{original}}\" não estava disponível. Usando \"{{fallback}}\" em vez disso. Você pode alterar isso nas Configurações."
},
"hotkeyUnavailable": {
"title": "Atalho indisponível",
diff --git a/src/locales/ru/translation.json b/src/locales/ru/translation.json
index 857a867c6..36ccf0acc 100644
--- a/src/locales/ru/translation.json
+++ b/src/locales/ru/translation.json
@@ -1851,7 +1851,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "Горячая клавиша изменена"
+ "title": "Горячая клавиша изменена",
+ "description": "\"{{original}}\" была недоступна. Вместо неё используется \"{{fallback}}\". Вы можете изменить это в Настройках."
},
"hotkeyUnavailable": {
"title": "Горячая клавиша недоступна",
diff --git a/src/locales/zh-CN/translation.json b/src/locales/zh-CN/translation.json
index 4dabe6a69..1ee17acbb 100644
--- a/src/locales/zh-CN/translation.json
+++ b/src/locales/zh-CN/translation.json
@@ -1846,7 +1846,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "快捷键已更改"
+ "title": "快捷键已更改",
+ "description": "\"{{original}}\" 不可用,已改用 \"{{fallback}}\"。您可以在设置中更改。"
},
"hotkeyUnavailable": {
"title": "快捷键不可用",
diff --git a/src/locales/zh-TW/translation.json b/src/locales/zh-TW/translation.json
index 49c54fb59..04641d5bd 100644
--- a/src/locales/zh-TW/translation.json
+++ b/src/locales/zh-TW/translation.json
@@ -1846,7 +1846,8 @@
"app": {
"toasts": {
"hotkeyChanged": {
- "title": "快捷鍵已變更"
+ "title": "快捷鍵已變更",
+ "description": "\"{{original}}\" 無法使用,已改用 \"{{fallback}}\"。您可以在設定中變更。"
},
"hotkeyUnavailable": {
"title": "快捷鍵無法使用",
diff --git a/src/stores/settingsStore.ts b/src/stores/settingsStore.ts
index e68df80d3..228cc4f0b 100644
--- a/src/stores/settingsStore.ts
+++ b/src/stores/settingsStore.ts
@@ -736,7 +736,13 @@ export async function initializeSettings(): Promise<void> {
if (activeKey) {
useSettingsStore.setState({ dictationKey: activeKey });
}
- } catch {}
+ } catch (err) {
+ logger.warn(
+ "Failed to sync active dictation key on startup",
+ { error: (err as Error).message },
+ "settings"
+ );
+ }
// Sync agent key from main process
try {
diff --git a/src/types/electron.ts b/src/types/electron.ts
index ea48a9e42..f6a17f9cd 100644
--- a/src/types/electron.ts
+++ b/src/types/electron.ts
@@ -721,7 +721,7 @@ declare global {
// Hotkey registration events
onHotkeyFallbackUsed?: (
- callback: (data: { original: string; fallback: string; message: string }) => void
+ callback: (data: { original: string; fallback: string }) => void
) => () => void;
onHotkeyRegistrationFailed?: (
callback: (data: { hotkey: string; error: string; suggestions: string[] }) => void