From 65d35c893c81c3dc51f9d2c8b838abb6640d6705 Mon Sep 17 00:00:00 2001 From: rammohan-y <37395033+rammohan-y@users.noreply.github.com> Date: Thu, 6 Feb 2025 18:36:56 +0530 Subject: [PATCH] Feat/1067 set default language if language is undefined (#1068) * sending recognition mode channel variable * change verb-specifications version * feat/1067 - setting default language to previously set language for the recognizer object if the vendor is default * added undefined check for fallbackVendor and fallbackLanguage --- lib/tasks/config.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/tasks/config.js b/lib/tasks/config.js index 72ec3c4b..b9cab89b 100644 --- a/lib/tasks/config.js +++ b/lib/tasks/config.js @@ -187,18 +187,20 @@ class TaskConfig extends Task { : cs.speechRecognizerVendor; cs.speechRecognizerLabel = this.recognizer.label === 'default' ? cs.speechRecognizerLabel : this.recognizer.label; - cs.speechRecognizerLanguage = this.recognizer.language !== 'default' + cs.speechRecognizerLanguage = this.recognizer.language !== undefined && this.recognizer.language !== 'default' ? this.recognizer.language : cs.speechRecognizerLanguage; //fallback - cs.fallbackSpeechRecognizerVendor = this.recognizer.fallbackVendor !== 'default' + cs.fallbackSpeechRecognizerVendor = this.recognizer.fallbackVendor !== undefined && + this.recognizer.fallbackVendor !== 'default' ? this.recognizer.fallbackVendor : cs.fallbackSpeechRecognizerVendor; cs.fallbackSpeechRecognizerLabel = this.recognizer.fallbackLabel === 'default' ? cs.fallbackSpeechRecognizerLabel : this.recognizer.fallbackLabel; - cs.fallbackSpeechRecognizerLanguage = this.recognizer.fallbackLanguage !== 'default' + cs.fallbackSpeechRecognizerLanguage = this.recognizer.fallbackLanguage !== undefined && + this.recognizer.fallbackLanguage !== 'default' ? this.recognizer.fallbackLanguage : cs.fallbackSpeechRecognizerLanguage;