fix: refresh recognition.lang before dictation start

After a runtime locale change (setLocale from Settings), the cached
recognition object retains its boot-time lang, causing dictation to
run in the wrong language. Set lang immediately before .start() at
the plain dictation path in _startMicCapture, matching the pattern
already used in _ensureSpeechRecognition().

Closes #5483
This commit is contained in:
root 2026-07-03 22:28:35 -03:00
parent f38cf44569
commit fe4e2851f7

View file

@ -930,6 +930,7 @@ function _micToastKeyForRecognitionError(error){
}
if(recognition && !_forceMediaRecorder && !_rawAudioMode){
_activeCaptureMode='speech';
recognition.lang=(typeof _locale!=='undefined'&&_locale._speech)||'en-US';
recognition.start();
_setRecording(true);
return;