Skip to content

armgit / Handy

Public Imported from GitHub
0

A free, open source, and extensible speech-to-text application that works completely offline.

fix: show that the model is loading instead of a stuck "Transcribing..." (#2227)

maurild1420a6685e85c0
diff --git a/src/i18n/locales/ar/translation.json b/src/i18n/locales/ar/translation.json
index cb816a44..20a3e283 100644
--- a/src/i18n/locales/ar/translation.json
+++ b/src/i18n/locales/ar/translation.json
@@ -1,7 +1,7 @@
{
"tray": {
- "settings": "...الإعدادات",
- "checkUpdates": "...التحقق من وجود تحديثات",
+ "settings": "الإعدادات...",
+ "checkUpdates": "التحقق من وجود تحديثات...",
"copyLastTranscript": "نسخ آخر نص تم تفريغه",
"unloadModel": "تفريغ النموذج",
"model": "النموذج",
@@ -112,7 +112,7 @@
},
"grant": "منح الإذن",
"granted": "تم المنح",
- "waiting": "...في الانتظار",
+ "waiting": "في الانتظار...",
"allGranted": "كل شيء جاهز!",
"errors": {
"checkFailed": "فشل التحقق من الأذونات. يرجير المحاولة مرة أخرى.",
@@ -127,14 +127,14 @@
"noModelsAvailable": "لا توجد نماذج متاحة",
"verifying": "جارٍ التحقق من {{modelName}}...",
"verifyingGeneric": "جارٍ التحقق...",
- "extracting": "...جاري استخراج {{modelName}}",
- "extractingMultiple": "...جاري استخراج {{count}} من النماذج",
- "extractingGeneric": "...جاري الاستخراج",
+ "extracting": "جاري استخراج {{modelName}}...",
+ "extractingMultiple": "جاري استخراج {{count}} من النماذج...",
+ "extractingGeneric": "جاري الاستخراج...",
"downloading": "جاري التنزيل {{percentage}}%",
"downloadingMultiple": "جاري تنزيل {{count}} من النماذج...",
"modelReady": "النموذج جاهز",
- "loading": "...جاري تحميل {{modelName}}",
- "loadingGeneric": "...جاري التحميل",
+ "loading": "جاري تحميل {{modelName}}...",
+ "loadingGeneric": "جاري التحميل...",
"modelError": "خطأ في النموذج",
"modelUnloaded": "تم إلغاء تحميل النموذج",
"noModelDownloadRequired": "لا يوجد نموذج - التنزيل مطلوب",
@@ -160,10 +160,10 @@
"shortcut": {
"title": "اختصارات Handy",
"description": "إعداد اختصارات لوحة المفاتيح لبدء تسجيل التفريغ الصوتي",
- "loading": "...جاري تحميل الاختصارات",
+ "loading": "جاري تحميل الاختصارات...",
"none": "لا توجد اختصارات مجهزة",
"notFound": "الاختصار غير موجود",
- "pressKeys": "...اضغط على المفاتيح",
+ "pressKeys": "اضغط على المفاتيح...",
"bindings": {
"transcribe": {
"name": "اختصار التفريغ الصوتي",
@@ -211,8 +211,8 @@
"microphone": {
"title": "الميكروفون",
"description": "اختر جهاز الميكروفون المفضل لديك",
- "placeholder": "...اختر الميكروفون",
- "loading": "...جاري التحميل"
+ "placeholder": "اختر الميكروفون...",
+ "loading": "جاري التحميل..."
},
"channel": {
"title": "قناة الإدخال",
@@ -227,8 +227,8 @@
"outputDevice": {
"title": "جهاز الإخراج",
"description": "اختر جهاز إخراج الصوت المفضل لتنبيهات الصوت",
- "placeholder": "...اختر جهاز الإخراج",
- "loading": "...جاري التحميل"
+ "placeholder": "اختر جهاز الإخراج...",
+ "loading": "جاري التحميل..."
},
"volume": {
"title": "مستوى الصوت",
@@ -443,7 +443,7 @@
"history": {
"title": "السجل",
"openFolder": "فتح مجلد التسجيلات",
- "loading": "...جاري تحميل السجل",
+ "loading": "جاري تحميل السجل...",
"empty": "!لا يوجد تفريغ صوتي بعد. ابدأ التسجيل لبناء سجلك",
"copyToClipboard": "نسخ التفريغ إلى الحافظة",
"copyError": "تعذر نسخ التفريغ إلى الحافظة.",
@@ -648,13 +648,13 @@
}
},
"footer": {
- "checkingUpdates": "...جاري التحقق من وجود تحديثات",
+ "checkingUpdates": "جاري التحقق من وجود تحديثات...",
"updateAvailableShort": "تحديث متاح",
"upToDate": "محدث",
"updateCheckingDisabled": "تم تعطيل التحقق من التحديث",
- "downloading": "...جاري التنزيل {{progress}}%",
- "installing": "...جاري التثبيت",
- "preparing": "...جاري التحضير",
+ "downloading": "جاري التنزيل {{progress}}%...",
+ "installing": "جاري التثبيت...",
+ "preparing": "جاري التحضير...",
"checkForUpdates": "التحقق من وجود تحديثات",
"portableUpdateTitle": "التحديث اليدوي مطلوب",
"portableUpdateMessage": "لا يمكن تحديث التثبيتات المحمولة تلقائيًا. نزّل المثبّت المناسب لنظامك من الزر أدناه، شغّله، وثبّته في المجلد نفسه — يبقى مجلد Data/ (الإعدادات والنماذج والتسجيلات) في مكانه.",
@@ -663,7 +663,7 @@
"portableUpdateBrowseButton": "فتح GitHub Releases"
},
"common": {
- "loading": "...جاري التحميل",
+ "loading": "جاري التحميل...",
"delete": "حذف",
"close": "إغلاق",
"open": "فتح",
@@ -707,8 +707,9 @@
}
},
"overlay": {
- "transcribing": "...جاري التفريغ",
- "processing": "...جاري المعالجة"
+ "transcribing": "جاري التفريغ...",
+ "processing": "جاري المعالجة...",
+ "loadingModel": "جارٍ تحميل النموذج..."
},
"whatsNew": {
"title": "الجديد في Handy v{{version}}"
diff --git a/src/i18n/locales/bg/translation.json b/src/i18n/locales/bg/translation.json
index 6c79810a..74838b16 100644
--- a/src/i18n/locales/bg/translation.json
+++ b/src/i18n/locales/bg/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Транскрибиране...",
- "processing": "Обработка..."
+ "processing": "Обработка...",
+ "loadingModel": "Зареждане на модела..."
},
"whatsNew": {
"title": "Ново в Handy v{{version}}"
diff --git a/src/i18n/locales/ca/translation.json b/src/i18n/locales/ca/translation.json
index 4685baf6..885fb8e1 100644
--- a/src/i18n/locales/ca/translation.json
+++ b/src/i18n/locales/ca/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "S'està transcrivint...",
- "processing": "S'està processant..."
+ "processing": "S'està processant...",
+ "loadingModel": "S'està carregant el model..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} pot estar blocant 1 drecera",
diff --git a/src/i18n/locales/cs/translation.json b/src/i18n/locales/cs/translation.json
index a7e327c6..f7f7003e 100644
--- a/src/i18n/locales/cs/translation.json
+++ b/src/i18n/locales/cs/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Přepisuji...",
- "processing": "Zpracovávám..."
+ "processing": "Zpracovávám...",
+ "loadingModel": "Načítání modelu..."
},
"whatsNew": {
"title": "Novinky v Handy v{{version}}"
diff --git a/src/i18n/locales/da/translation.json b/src/i18n/locales/da/translation.json
index 10a0dd0d..be3f519d 100644
--- a/src/i18n/locales/da/translation.json
+++ b/src/i18n/locales/da/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "Transskriberer...",
- "processing": "Behandler..."
+ "processing": "Behandler...",
+ "loadingModel": "Indlæser model..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} blokerer muligvis 1 genvej",
diff --git a/src/i18n/locales/de/translation.json b/src/i18n/locales/de/translation.json
index f159a774..7b192d2c 100644
--- a/src/i18n/locales/de/translation.json
+++ b/src/i18n/locales/de/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transkribiere...",
- "processing": "Verarbeite..."
+ "processing": "Verarbeite...",
+ "loadingModel": "Modell wird geladen..."
},
"whatsNew": {
"title": "Neu in Handy v{{version}}"
diff --git a/src/i18n/locales/en/translation.json b/src/i18n/locales/en/translation.json
index 440ebace..088a11c2 100644
--- a/src/i18n/locales/en/translation.json
+++ b/src/i18n/locales/en/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "Transcribing...",
- "processing": "Processing..."
+ "processing": "Processing...",
+ "loadingModel": "Loading model..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} may be blocking 1 shortcut",
diff --git a/src/i18n/locales/es/translation.json b/src/i18n/locales/es/translation.json
index 9fb2be11..8af84005 100644
--- a/src/i18n/locales/es/translation.json
+++ b/src/i18n/locales/es/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transcribiendo...",
- "processing": "Procesando..."
+ "processing": "Procesando...",
+ "loadingModel": "Cargando modelo..."
},
"whatsNew": {
"title": "Nuevo en Handy v{{version}}"
diff --git a/src/i18n/locales/fr/translation.json b/src/i18n/locales/fr/translation.json
index d2a59048..6349029a 100644
--- a/src/i18n/locales/fr/translation.json
+++ b/src/i18n/locales/fr/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transcription...",
- "processing": "Traitement..."
+ "processing": "Traitement...",
+ "loadingModel": "Chargement du modèle..."
},
"whatsNew": {
"title": "Nouveautés de Handy v{{version}}"
diff --git a/src/i18n/locales/he/translation.json b/src/i18n/locales/he/translation.json
index ecd43625..d05ec5c0 100644
--- a/src/i18n/locales/he/translation.json
+++ b/src/i18n/locales/he/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "מתמלל...",
- "processing": "מעבד..."
+ "processing": "מעבד...",
+ "loadingModel": "טוען מודל..."
},
"whatsNew": {
"title": "חדש ב-Handy v{{version}}"
diff --git a/src/i18n/locales/hi/translation.json b/src/i18n/locales/hi/translation.json
index 50b5041b..1397efef 100644
--- a/src/i18n/locales/hi/translation.json
+++ b/src/i18n/locales/hi/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "ट्रांसक्राइब हो रहा है...",
- "processing": "प्रोसेस हो रहा है..."
+ "processing": "प्रोसेस हो रहा है...",
+ "loadingModel": "मॉडल लोड हो रहा है..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} शायद 1 शॉर्टकट को ब्लॉक कर रहा है",
diff --git a/src/i18n/locales/id/translation.json b/src/i18n/locales/id/translation.json
index 43fc1d91..04793263 100644
--- a/src/i18n/locales/id/translation.json
+++ b/src/i18n/locales/id/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "Mentranskripsikan...",
- "processing": "Memproses..."
+ "processing": "Memproses...",
+ "loadingModel": "Memuat model..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} mungkin memblokir 1 pintasan",
diff --git a/src/i18n/locales/it/translation.json b/src/i18n/locales/it/translation.json
index 59a29f54..7ee19417 100644
--- a/src/i18n/locales/it/translation.json
+++ b/src/i18n/locales/it/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Trascrizione...",
- "processing": "Elaborazione..."
+ "processing": "Elaborazione...",
+ "loadingModel": "Caricamento del modello..."
},
"whatsNew": {
"title": "Novità in Handy v{{version}}"
diff --git a/src/i18n/locales/ja/translation.json b/src/i18n/locales/ja/translation.json
index ba02949b..ee580764 100644
--- a/src/i18n/locales/ja/translation.json
+++ b/src/i18n/locales/ja/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "文字起こし中…",
- "processing": "処理中…"
+ "processing": "処理中…",
+ "loadingModel": "モデルを読み込み中…"
},
"whatsNew": {
"title": "Handy v{{version}} の新機能"
diff --git a/src/i18n/locales/ko/translation.json b/src/i18n/locales/ko/translation.json
index 8f5130bd..9f9b3fd3 100644
--- a/src/i18n/locales/ko/translation.json
+++ b/src/i18n/locales/ko/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "텍스트로 변환 중...",
- "processing": "처리 중..."
+ "processing": "처리 중...",
+ "loadingModel": "모델 로딩 중..."
},
"whatsNew": {
"title": "Handy v{{version}}의 새 소식"
diff --git a/src/i18n/locales/ne/translation.json b/src/i18n/locales/ne/translation.json
index c8949d65..8654dbc1 100644
--- a/src/i18n/locales/ne/translation.json
+++ b/src/i18n/locales/ne/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "ट्रान्सक्राइब गरिँदैछ...",
- "processing": "प्रशोधन गरिँदैछ..."
+ "processing": "प्रशोधन गरिँदैछ...",
+ "loadingModel": "मोडेल लोड गरिँदैछ..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} ले 1 सर्टकट रोकिरहेको हुन सक्छ",
diff --git a/src/i18n/locales/nl/translation.json b/src/i18n/locales/nl/translation.json
index c50e93fd..efe20a69 100644
--- a/src/i18n/locales/nl/translation.json
+++ b/src/i18n/locales/nl/translation.json
@@ -711,7 +711,8 @@
},
"overlay": {
"transcribing": "Transcriberen...",
- "processing": "Verwerken..."
+ "processing": "Verwerken...",
+ "loadingModel": "Model laden..."
},
"secureInput": {
"blockedWithCulprit_one": "{{name}} blokkeert mogelijk 1 sneltoets",
diff --git a/src/i18n/locales/pl/translation.json b/src/i18n/locales/pl/translation.json
index 24d7ebeb..f9a40d33 100644
--- a/src/i18n/locales/pl/translation.json
+++ b/src/i18n/locales/pl/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transkrypcja...",
- "processing": "Przetwarzanie..."
+ "processing": "Przetwarzanie...",
+ "loadingModel": "Wczytywanie modelu..."
},
"whatsNew": {
"title": "Nowości w Handy v{{version}}"
diff --git a/src/i18n/locales/pt/translation.json b/src/i18n/locales/pt/translation.json
index 0932d46d..97916a8e 100644
--- a/src/i18n/locales/pt/translation.json
+++ b/src/i18n/locales/pt/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transcrevendo...",
- "processing": "Processando..."
+ "processing": "Processando...",
+ "loadingModel": "Carregando modelo..."
},
"whatsNew": {
"title": "Novidades no Handy v{{version}}"
diff --git a/src/i18n/locales/ru/translation.json b/src/i18n/locales/ru/translation.json
index 6cf5fae5..bf5b3c43 100644
--- a/src/i18n/locales/ru/translation.json
+++ b/src/i18n/locales/ru/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Расшифровка...",
- "processing": "Обработка..."
+ "processing": "Обработка...",
+ "loadingModel": "Загрузка модели..."
},
"whatsNew": {
"title": "Новое в Handy v{{version}}"
diff --git a/src/i18n/locales/sv/translation.json b/src/i18n/locales/sv/translation.json
index 2d29ec61..68f39f53 100644
--- a/src/i18n/locales/sv/translation.json
+++ b/src/i18n/locales/sv/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transkriberar...",
- "processing": "Bearbetar..."
+ "processing": "Bearbetar...",
+ "loadingModel": "Laddar modell..."
},
"whatsNew": {
"title": "Nytt i Handy v{{version}}"
diff --git a/src/i18n/locales/tr/translation.json b/src/i18n/locales/tr/translation.json
index 343ccad4..d8375de9 100644
--- a/src/i18n/locales/tr/translation.json
+++ b/src/i18n/locales/tr/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Transkribe ediliyor...",
- "processing": "İşleniyor..."
+ "processing": "İşleniyor...",
+ "loadingModel": "Model yükleniyor..."
},
"whatsNew": {
"title": "Handy v{{version}} yenilikleri"
diff --git a/src/i18n/locales/uk/translation.json b/src/i18n/locales/uk/translation.json
index ab37f686..7ba5ea91 100644
--- a/src/i18n/locales/uk/translation.json
+++ b/src/i18n/locales/uk/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Обробка...",
- "processing": "Постобробка..."
+ "processing": "Постобробка...",
+ "loadingModel": "Завантаження моделі..."
},
"whatsNew": {
"title": "Нове в Handy v{{version}}"
diff --git a/src/i18n/locales/vi/translation.json b/src/i18n/locales/vi/translation.json
index 554c4002..01acfadc 100644
--- a/src/i18n/locales/vi/translation.json
+++ b/src/i18n/locales/vi/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "Đang chuyển đổi...",
- "processing": "Đang xử lý..."
+ "processing": "Đang xử lý...",
+ "loadingModel": "Đang tải mô hình..."
},
"whatsNew": {
"title": "Điểm mới trong Handy v{{version}}"
diff --git a/src/i18n/locales/zh-TW/translation.json b/src/i18n/locales/zh-TW/translation.json
index 2bcba311..0401459b 100644
--- a/src/i18n/locales/zh-TW/translation.json
+++ b/src/i18n/locales/zh-TW/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "正在轉錄...",
- "processing": "處理中..."
+ "processing": "處理中...",
+ "loadingModel": "正在載入模型..."
},
"whatsNew": {
"title": "Handy v{{version}} 新功能"
diff --git a/src/i18n/locales/zh/translation.json b/src/i18n/locales/zh/translation.json
index b8ec5dcd..0422d633 100644
--- a/src/i18n/locales/zh/translation.json
+++ b/src/i18n/locales/zh/translation.json
@@ -708,7 +708,8 @@
},
"overlay": {
"transcribing": "正在转录...",
- "processing": "处理中..."
+ "processing": "处理中...",
+ "loadingModel": "正在加载模型..."
},
"whatsNew": {
"title": "Handy v{{version}} 新功能"
diff --git a/src/overlay/RecordingOverlay.tsx b/src/overlay/RecordingOverlay.tsx
index dbab41e1..3085c747 100644
--- a/src/overlay/RecordingOverlay.tsx
+++ b/src/overlay/RecordingOverlay.tsx
@@ -10,6 +10,7 @@ import type {
StreamWorkKind,
} from "@/bindings";
import i18n, { syncLanguageFromSettings } from "@/i18n";
+import type { ModelStateEvent } from "@/lib/types/events";
import { getLanguageDirection } from "@/lib/utils/rtl";
type OverlayState = "recording" | "streaming" | "transcribing" | "processing";
@@ -26,6 +27,10 @@ const RecordingOverlay: React.FC = () => {
// Stay visually in an arming state until the backend processes the first
// actual microphone sample chunk.
const [captureReady, setCaptureReady] = useState(false);
+ // Recording starts while the model loads in the background. If the user stops
+ // before the load finishes, the wait is the load, not the transcription — say
+ // so, otherwise a cold start looks like a hung "Transcribing..." spinner.
+ const [modelLoading, setModelLoading] = useState(false);
const [levels, setLevels] = useState<number[]>(Array(WAVE_BARS).fill(0));
const [streamText, setStreamText] = useState<StreamTextEvent>({
committed: "",
@@ -121,6 +126,15 @@ const RecordingOverlay: React.FC = () => {
if (payload.kind) setWorkKind(payload.kind);
});
+ // Every other model event (completed, failed, unloaded, selection
+ // changed) means no load is in flight.
+ const unlistenModel = await listen<ModelStateEvent>(
+ "model-state-changed",
+ (event) => {
+ setModelLoading(event.payload.event_type === "loading_started");
+ },
+ );
+
return () => {
unlistenShow();
unlistenHide();
@@ -128,6 +142,7 @@ const RecordingOverlay: React.FC = () => {
unlistenLevel();
unlistenStream();
unlistenPhase();
+ unlistenModel();
};
};
@@ -169,6 +184,10 @@ const RecordingOverlay: React.FC = () => {
const fmtTime = (s: number) =>
`${Math.floor(s / 60)}:${String(s % 60).padStart(2, "0")}`;
+ const transcribingLabel = modelLoading
+ ? t("overlay.loadingModel")
+ : t("overlay.transcribing");
+
// ---- Shared building blocks (one visual language for every overlay form) ----
const waveform = (
<div className={`swave ${captureReady ? "ready" : "arming"}`}>
@@ -270,7 +289,7 @@ const RecordingOverlay: React.FC = () => {
? workingRow(
workKind === "polishing"
? t("overlay.processing")
- : t("overlay.transcribing"),
+ : transcribingLabel,
true,
)
: listeningRow(open, true)}
@@ -284,9 +303,7 @@ const RecordingOverlay: React.FC = () => {
// width between them; the cancel button is in both rows so it stays put.
const working = state === "transcribing" || state === "processing";
const workLabel =
- state === "processing"
- ? t("overlay.processing")
- : t("overlay.transcribing");
+ state === "processing" ? t("overlay.processing") : transcribingLabel;
return (
<div