fix: Skips setting language for transcriptions if not enabled.

This commit is contained in:
Дамян Минков 2021-10-01 10:23:46 -05:00
parent 1beed8c490
commit 576fd0d343
1 changed files with 6 additions and 1 deletions

View File

@ -15,7 +15,12 @@ const DEFAULT_TRANSCRIBER_LANG = 'en-US';
* @returns {string} * @returns {string}
*/ */
export function determineTranscriptionLanguage(config: Object) { export function determineTranscriptionLanguage(config: Object) {
const { preferredTranscribeLanguage, transcribeWithAppLanguage = true } = config; const { preferredTranscribeLanguage, transcribeWithAppLanguage = true, transcribingEnabled } = config;
// if transcriptions are not enabled nothing to determine
if (!transcribingEnabled) {
return undefined;
}
// Depending on the config either use the language that the app automatically detected or the hardcoded // Depending on the config either use the language that the app automatically detected or the hardcoded
// config BCP47 value. // config BCP47 value.