Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dynamic-branding) support setting transcription language #15371

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion react/features/base/conference/functions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 };
Expand All @@ -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) {
Expand Down
13 changes: 13 additions & 0 deletions react/features/base/i18n/middleware.ts
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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;
}
}
Expand Down
1 change: 1 addition & 0 deletions react/features/dynamic-branding/reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ export interface IDynamicBrandingState {
customizationFailed: boolean;
customizationReady: boolean;
defaultBranding: boolean;
defaultTranscriptionLanguage?: boolean;
didPageUrl: string;
inviteDomain: string;
labels: Object | null;
Expand Down
Loading