feat(dynamic-branding) support setting transcription language

It will be used as the default if specified.
This commit is contained in:
Saúl Ibarra Corretgé
2024-12-09 14:54:54 +01:00
committed by Saúl Ibarra Corretgé
parent f85d0e6469
commit 83192435e7
3 changed files with 17 additions and 1 deletions

View File

@@ -208,6 +208,7 @@ export function getConferenceOptions(stateful: IStateful) {
const config = state['features/base/config'];
const { locationURL } = state['features/base/connection'];
const { defaultTranscriptionLanguage } = state['features/dynamic-branding'];
const { tenant } = state['features/base/jwt'];
const { email, name: nick } = getLocalParticipant(state) ?? {};
const options: any = { ...config };
@@ -229,7 +230,8 @@ export function getConferenceOptions(stateful: IStateful) {
}
options.applicationName = getName();
options.transcriptionLanguage = determineTranscriptionLanguage(options);
options.transcriptionLanguage
= defaultTranscriptionLanguage ?? determineTranscriptionLanguage(options);
// Disable analytics, if requested.
if (options.disableThirdPartyRequests) {

View File

@@ -1,4 +1,5 @@
import { SET_DYNAMIC_BRANDING_DATA } from '../../dynamic-branding/actionTypes';
import { getConferenceState } from '../conference/functions';
import MiddlewareRegistry from '../redux/MiddlewareRegistry';
import { I18NEXT_INITIALIZED, LANGUAGE_CHANGED } from './actionTypes';
@@ -28,6 +29,18 @@ MiddlewareRegistry.register(store => next => action => {
logger.log('Error setting dynamic language bundle', err);
});
}
// Update transcription language, if applicable.
if (action.type === SET_DYNAMIC_BRANDING_DATA) {
const { defaultTranscriptionLanguage } = action.value;
if (typeof defaultTranscriptionLanguage !== 'undefined') {
const { conference } = getConferenceState(store.getState());
conference?.setTranscriptionLanguage(defaultTranscriptionLanguage);
}
}
break;
}
}

View File

@@ -150,6 +150,7 @@ export interface IDynamicBrandingState {
customizationFailed: boolean;
customizationReady: boolean;
defaultBranding: boolean;
defaultTranscriptionLanguage?: boolean;
didPageUrl: string;
inviteDomain: string;
labels: Object | null;