Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(live-translation): move the translation indicator to the conference label

Jaya Allamsetty6e371fb23a5d
diff --git a/lang/main-ca.json b/lang/main-ca.json
index c304398b88..cd35a3a01f 100644
--- a/lang/main-ca.json
+++ b/lang/main-ca.json
@@ -1712,16 +1712,10 @@
"mute": "El participant està silenciat",
"muted": "Silenciat",
"pinToStage": "Fixa a l'escena",
- "receivingTranslatedAudio": "Esteu rebent àudio traduït",
"remoteControl": "Inicia o atura el control remot",
"screenSharing": "El participant està compartint la pantalla",
"show": "Mostra-ho en l'escena",
"showSelfView": "Mostra la visualització d'un mateix",
- "translationEnabledForYou": "Traducció habilitada",
- "translationOnAndReceiving": "Traducció activa · recepció",
- "translationStillListening": "{{count}} participant encara escolta la traducció — espereu abans de parlar",
- "translationStillListeningShort": "{{num}} encara escolten",
- "translationStillListening_plural": "{{count}} participants encara estan escoltant la traducció — espereu abans de parlar",
"unpinFromStage": "Deixa de fixar",
"verify": "Verifica el participant",
"videoMuted": "La càmera està desactivada",
diff --git a/lang/main-de.json b/lang/main-de.json
index a1ca25a82c..0c0f891d9b 100644
--- a/lang/main-de.json
+++ b/lang/main-de.json
@@ -1650,13 +1650,10 @@
"mute": "Person ist stummgeschaltet",
"muted": "Stummgeschaltet",
"pinToStage": "Anheften",
- "receivingTranslatedAudio": "Sie empfangen übersetzten Ton",
"remoteControl": "Fernsteuerung",
"screenSharing": "Person teilt den Bildschirm",
"show": "Im Vordergrund anzeigen",
"showSelfView": "Eigene Ansicht anzeigen",
- "translationEnabledForYou": "Übersetzung für Sie aktiviert",
- "translationOnAndReceiving": "Übersetzung eingeschaltet · empfange",
"unpinFromStage": "Lösen",
"verify": "Person verifizieren",
"videoMuted": "Kamera ausgeschaltet",
diff --git a/lang/main-es.json b/lang/main-es.json
index d0ac1ae612..881e61bfcc 100644
--- a/lang/main-es.json
+++ b/lang/main-es.json
@@ -1703,16 +1703,10 @@
"mute": "Se silenció el participante",
"muted": "Silenciado",
"pinToStage": "Fijar en el escenario",
- "receivingTranslatedAudio": "Está recibiendo audio traducido",
"remoteControl": "Iniciar / detener el control remoto",
"screenSharing": "El participante está compartiendo su pantalla",
"show": "Mostrar en primer plano",
"showSelfView": "Mostrar vista propia",
- "translationEnabledForYou": "Traducción activada para usted",
- "translationOnAndReceiving": "Traducción activada · recibiendo",
- "translationStillListening": "{{count}} participante aún está escuchando la traducción: espere antes de hablar",
- "translationStillListeningShort": "{{num}} aún escuchando",
- "translationStillListening_plural": "{{count}} participantes aún están escuchando la traducción: espere antes de hablar",
"unpinFromStage": "Dejar de fijar",
"verify": "Verificar participante",
"videoMuted": "Cámara desactivada",
diff --git a/lang/main-hi.json b/lang/main-hi.json
index beaea7302f..0634a24dcb 100644
--- a/lang/main-hi.json
+++ b/lang/main-hi.json
@@ -1652,13 +1652,10 @@
"mute": "प्रतिभागी मौन है",
"muted": "म्यूटेड",
"pinToStage": "स्टेज पर पिन करें",
- "receivingTranslatedAudio": "आप अनुवादित ऑडियो प्राप्त कर रहे हैं",
"remoteControl": "स्टार्ट / स्टॉप रिमोट कंट्रोल",
"screenSharing": "प्रतिभागी स्क्रीन साझा कर रहे हैं",
"show": "स्टेज पर दिखाएं",
"showSelfView": "स्व-दृश्य दिखाएं",
- "translationEnabledForYou": "आपके लिए अनुवाद सक्षम है",
- "translationOnAndReceiving": "अनुवाद चालू · प्राप्त हो रहा है",
"unpinFromStage": "अनपिन करें",
"verify": "प्रतिभागी को सत्यापित करें",
"videoMuted": "कैमरा अक्षम",
diff --git a/lang/main-lv.json b/lang/main-lv.json
index f758293989..52a5c3c11f 100644
--- a/lang/main-lv.json
+++ b/lang/main-lv.json
@@ -1701,16 +1701,10 @@
"mute": "Noklusināt",
"muted": "Noklusināts (bez skaņas)",
"pinToStage": "Piestiprināt tuvplānā",
- "receivingTranslatedAudio": "Jūs saņemat tulkoto audio",
"remoteControl": "Ieslēgt/izslēgt tālvadību",
"screenSharing": "Dalībnieks kopīgo savu ekrānu",
"show": "Parādīt tuvplānu",
"showSelfView": "Rādīt pašskatu",
- "translationEnabledForYou": "Tulkošana jums ir iespējota",
- "translationOnAndReceiving": "Tulkošana ieslēgta · tiek saņemta",
- "translationStillListening": "{{count}} dalībnieks joprojām klausās tulkojumu — uzgaidiet pirms runāšanas",
- "translationStillListeningShort": "{{num}} joprojām klausās",
- "translationStillListening_plural": "{{count}} dalībnieki joprojām klausās tulkojumu — uzgaidiet pirms runāšanas",
"unpinFromStage": "Noņemt no tuvplāna",
"verify": "Apstiprināt dalībnieku",
"videoMuted": "Kamera izslēgta",
diff --git a/lang/main-nl.json b/lang/main-nl.json
index b7c148c099..293fb16cc6 100644
--- a/lang/main-nl.json
+++ b/lang/main-nl.json
@@ -1712,16 +1712,10 @@
"mute": "Deelnemer is gedempt",
"muted": "Gedempt",
"pinToStage": "Vastzetten aan het podium",
- "receivingTranslatedAudio": "U ontvangt vertaalde audio",
"remoteControl": "Extern beheer starten / stoppen",
"screenSharing": "Deelnemer deelt hun scherm",
"show": "Op podium weergeven",
"showSelfView": "Zelfbeeld weergeven",
- "translationEnabledForYou": "Vertaling is voor u ingeschakeld",
- "translationOnAndReceiving": "Vertaling op · ontvangen",
- "translationStillListening": "{{count}} deelnemer luistert nog naar de vertaling — wacht met spreken",
- "translationStillListeningShort": "{{num}} luistert nog",
- "translationStillListening_plural": "{{count}} deelnemers luisteren nog naar de vertaling — wacht met spreken",
"unpinFromStage": "Losmaken",
"verify": "Deelnemer verifiëren",
"videoMuted": "Camera uitgeschakeld",
diff --git a/lang/main.json b/lang/main.json
index ec98415da7..13062a8600 100644
--- a/lang/main.json
+++ b/lang/main.json
@@ -46,7 +46,8 @@
"errorLimitReached": "Couldn't translate everyone at once. Turn on translation for individual participants instead.",
"errorRoomDisabled": "Audio translation is turned off for this meeting. Enable it in Moderator settings.",
"errorSpeakerUnavailable": "Can't translate this participant — they're no longer in the meeting.",
- "labelTooltip": "Translation in progress"
+ "labelTooltip": "Translation in progress",
+ "labelTooltipPlaying": "Translated audio is still playing — wait before speaking"
},
"bandwidthSettings": {
"assumedBandwidthBps": "e.g. 10000000 for 10 Mbps",
@@ -1717,16 +1718,10 @@
"mute": "Participant is muted",
"muted": "Muted",
"pinToStage": "Pin to stage",
- "receivingTranslatedAudio": "You're receiving translated audio",
"remoteControl": "Start / Stop remote control",
"screenSharing": "Participant is sharing their screen",
"show": "Show on stage",
"showSelfView": "Show self view",
- "translationEnabledForYou": "Translation enabled for you",
- "translationOnAndReceiving": "Translation on · receiving",
- "translationStillListening": "{{count}} participant is still hearing the translation — wait before speaking",
- "translationStillListeningShort": "{{num}} still listening",
- "translationStillListening_plural": "{{count}} participants are still hearing the translation — wait before speaking",
"unpinFromStage": "Unpin",
"verify": "Verify participant",
"videoMuted": "Camera disabled",
diff --git a/react/features/audio-translation/components/native/TranslationExpandedLabel.ts b/react/features/audio-translation/components/native/TranslationExpandedLabel.ts
index 5ba6d3dacd..a4f5bf11a9 100644
--- a/react/features/audio-translation/components/native/TranslationExpandedLabel.ts
+++ b/react/features/audio-translation/components/native/TranslationExpandedLabel.ts
@@ -1,14 +1,23 @@
import { WithTranslation } from 'react-i18next';
+import { connect } from 'react-redux';
+import { IReduxState } from '../../../app/types';
import { translate } from '../../../base/i18n/functions';
import ExpandedLabel, { IProps as AbstractProps } from '../../../base/label/components/native/ExpandedLabel';
+import { isTranslationPlayingOut } from '../../functions';
-type Props = AbstractProps & WithTranslation;
+interface IProps extends AbstractProps, WithTranslation {
+
+ /**
+ * Whether a speaker's translated audio is still playing out.
+ */
+ _playingOut: boolean;
+}
/**
* A tooltip-like expanded label explaining the meaning of the audio-translation conference label.
*/
-class TranslationExpandedLabel extends ExpandedLabel<Props> {
+class TranslationExpandedLabel extends ExpandedLabel<IProps> {
/**
* Returns the label specific text of this {@code ExpandedLabel}.
@@ -16,8 +25,25 @@ class TranslationExpandedLabel extends ExpandedLabel<Props> {
* @returns {string}
*/
_getLabel() {
- return this.props.t('audioTranslation.labelTooltip');
+ const { _playingOut, t } = this.props;
+
+ return t(_playingOut ? 'audioTranslation.labelTooltipPlaying' : 'audioTranslation.labelTooltip');
}
}
-export default translate(TranslationExpandedLabel);
+/**
+ * Maps (parts of) the Redux state to the associated {@code TranslationExpandedLabel}'s props.
+ *
+ * @param {IReduxState} state - The Redux state.
+ * @private
+ * @returns {{
+ * _playingOut: boolean
+ * }}
+ */
+function _mapStateToProps(state: IReduxState) {
+ return {
+ _playingOut: isTranslationPlayingOut(state)
+ };
+}
+
+export default translate(connect(_mapStateToProps)(TranslationExpandedLabel));
diff --git a/react/features/audio-translation/components/native/TranslationLabel.tsx b/react/features/audio-translation/components/native/TranslationLabel.tsx
index c1341c26bd..e93a1cd836 100644
--- a/react/features/audio-translation/components/native/TranslationLabel.tsx
+++ b/react/features/audio-translation/components/native/TranslationLabel.tsx
@@ -1,12 +1,24 @@
import React from 'react';
import { useSelector } from 'react-redux';
-import { IconTranslate } from '../../../base/icons/svg';
+import { IconTranslate, IconTranslateWave } from '../../../base/icons/svg';
import Label from '../../../base/label/components/native/Label';
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
-import { isAudioTranslationActiveInMeeting, isAudioTranslationAvailable } from '../../functions';
+import {
+ isAudioTranslationActiveInMeeting,
+ isAudioTranslationAvailable,
+ isTranslationPlayingOut
+} from '../../functions';
const styles = {
+ playingOutLabel: {
+ alignItems: 'center',
+ backgroundColor: BaseTheme.palette.warning03,
+ borderRadius: BaseTheme.shape.borderRadius,
+ flexDirection: 'row',
+ marginBottom: BaseTheme.spacing[0],
+ marginLeft: BaseTheme.spacing[0]
+ },
translationLabel: {
alignItems: 'center',
backgroundColor: BaseTheme.palette.action01,
@@ -18,19 +30,21 @@ const styles = {
};
/**
- * Conference-header label shown while audio translation is active in the meeting.
+ * Conference-header label shown while audio translation is active in the meeting. Turns amber while a
+ * speaker's translated audio is still playing out, so everyone knows to wait before speaking.
*
* @returns {ReactElement|null}
*/
const TranslationLabel = () => {
const available = useSelector(isAudioTranslationAvailable);
const active = useSelector(isAudioTranslationActiveInMeeting);
+ const playingOut = useSelector(isTranslationPlayingOut);
- return available && active ? (
+ return available && (active || playingOut) ? (
<Label
- icon = { IconTranslate }
+ icon = { playingOut ? IconTranslateWave : IconTranslate }
iconColor = { BaseTheme.palette.icon01 }
- style = { styles.translationLabel } />
+ style = { playingOut ? styles.playingOutLabel : styles.translationLabel } />
) : null;
};
diff --git a/react/features/audio-translation/components/web/TranslationLabel.tsx b/react/features/audio-translation/components/web/TranslationLabel.tsx
index 9acb47d310..1540609d4e 100644
--- a/react/features/audio-translation/components/web/TranslationLabel.tsx
+++ b/react/features/audio-translation/components/web/TranslationLabel.tsx
@@ -3,13 +3,16 @@ import { useTranslation } from 'react-i18next';
import { useSelector } from 'react-redux';
import { makeStyles } from 'tss-react/mui';
-import { IconTranslate } from '../../../base/icons/svg';
+import { IconTranslate, IconTranslateWave } from '../../../base/icons/svg';
import Label from '../../../base/label/components/web/Label';
import Tooltip from '../../../base/tooltip/components/Tooltip';
-import { isAudioTranslationActiveInMeeting } from '../../functions';
+import { isAudioTranslationActiveInMeeting, isTranslationPlayingOut } from '../../functions';
const useStyles = makeStyles()(theme => {
return {
+ playingOut: {
+ background: theme.palette.warning03
+ },
translation: {
background: theme.palette.action01
}
@@ -17,7 +20,8 @@ const useStyles = makeStyles()(theme => {
});
/**
- * Conference-header label shown while audio translation is active in the meeting.
+ * Conference-header label shown while audio translation is active in the meeting. Turns amber while a
+ * speaker's translated audio is still playing out, so everyone knows to wait before speaking.
*
* @returns {ReactElement|null}
*/
@@ -25,12 +29,14 @@ const TranslationLabel = () => {
const { classes: styles } = useStyles();
const { t } = useTranslation();
const active = useSelector(isAudioTranslationActiveInMeeting);
+ const playingOut = useSelector(isTranslationPlayingOut);
- if (!active) {
+ // playingOut can outlast the control-plane signals, and it is the one state worth waiting on.
+ if (!active && !playingOut) {
return null;
}
- const content = t('audioTranslation.labelTooltip');
+ const content = t(playingOut ? 'audioTranslation.labelTooltipPlaying' : 'audioTranslation.labelTooltip');
return (
<Tooltip
@@ -38,8 +44,8 @@ const TranslationLabel = () => {
position = { 'bottom' }>
<Label
accessibilityText = { content }
- className = { styles.translation }
- icon = { IconTranslate } />
+ className = { playingOut ? styles.playingOut : styles.translation }
+ icon = { playingOut ? IconTranslateWave : IconTranslate } />
</Tooltip>
);
};
diff --git a/react/features/audio-translation/constants.ts b/react/features/audio-translation/constants.ts
index 3cc1aa3b46..2c0e50c4f9 100644
--- a/react/features/audio-translation/constants.ts
+++ b/react/features/audio-translation/constants.ts
@@ -26,30 +26,3 @@ export const DEFAULT_ORIGINAL_VOLUME = 1;
* Volume (0..1) a speaker's original audio is ducked to while its translation plays.
*/
export const DUCKED_ORIGINAL_VOLUME = 0.15;
-
-/**
- * The per-participant audio-translation status the thumbnail indicator renders, combining whether translation
- * is enabled for the local user and whether translated audio is actually being received.
- */
-export enum TranslationTreatment {
-
- /**
- * Translation is enabled for the local user AND translated audio is being received.
- */
- BOTH = 'both',
-
- /**
- * Translation is enabled for the local user but no translated audio is being received yet.
- */
- ENABLED = 'enabled',
-
- /**
- * Neither enabled nor receiving — the indicator renders nothing.
- */
- NONE = 'none',
-
- /**
- * Translated audio is being received without translation having been explicitly enabled.
- */
- RECEIVING = 'receiving'
-}
diff --git a/react/features/audio-translation/functions.ts b/react/features/audio-translation/functions.ts
index 2e64fb7614..a86f581d25 100644
--- a/react/features/audio-translation/functions.ts
+++ b/react/features/audio-translation/functions.ts
@@ -6,7 +6,7 @@ import { isJwtFeatureEnabled } from '../base/jwt/functions';
import { isLocalParticipantModerator } from '../base/participants/functions';
import { ITrack } from '../base/tracks/types';
-import { DUCKED_ORIGINAL_VOLUME, TranslationTreatment } from './constants';
+import { DUCKED_ORIGINAL_VOLUME } from './constants';
/**
* Whether audio translation is enabled for the room. Driven by the {@code audioTranslation} RoomMetadata flag,
@@ -19,93 +19,6 @@ export function isAudioTranslationRoomEnabled(state: IReduxState): boolean {
return state['features/base/conference'].metadata?.audioTranslation?.enabled !== false;
}
-/**
- * Whether the given participant is currently translating the local participant's audio, per the directed
- * {@code translationListeners} list pushed by the audio-translation component.
- *
- * @param {IReduxState} state - The redux state.
- * @param {string} participantId - The participant (endpoint) id to check.
- * @returns {boolean}
- */
-export function isParticipantAudioTranslationActive(state: IReduxState, participantId: string): boolean {
- return state['features/audio-translation'].translationListeners.includes(participantId);
-}
-
-/**
- * The target language encoded in a translated source name — the substring after the last {@code .}.
- *
- * @param {string} sourceName - The translated source name.
- * @returns {string}
- */
-export function getSourceLanguage(sourceName: string): string {
- const dotIndex = sourceName.lastIndexOf('.');
-
- return dotIndex === -1 ? '' : sourceName.substring(dotIndex + 1);
-}
-
-/**
- * The owner endpoint id encoded in a translated source name — the substring before the first {@code -}.
- * Translated sources follow the {@code <endpointId>-a<idx>.<lang>} convention (endpoint ids are dash/dot-free).
- * Returns an empty string for a source without a dash.
- *
- * @param {string} sourceName - The translated source name.
- * @returns {string}
- */
-export function getSourceOwnerEndpointId(sourceName: string): string {
- const dashIndex = sourceName.indexOf('-');
-
- return dashIndex === -1 ? '' : sourceName.substring(0, dashIndex);
-}
-
-/**
- * Whether we are hearing the given participant translated. The bridge floods sending changes to every
- * endpoint, so {@code receivingSources} is every translated source in flight anywhere, not just ours; a
- * source counts as ours only when its language matches the one we selected for this participant.
- *
- * @param {IReduxState} state - The redux state.
- * @param {string} participantId - The participant (endpoint) id to check.
- * @returns {boolean}
- */
-export function isReceivingTranslationFrom(state: IReduxState, participantId: string): boolean {
- const language = getEffectiveTranslationLanguage(state, participantId);
-
- // The bridge announces sending changes to every endpoint, so a source being in flight does not mean we
- // subscribed to it; require our own selection for this speaker to match the source's language.
- if (!language) {
- return false;
- }
-
- return state['features/audio-translation'].receivingSources
- .some(sourceName => getSourceOwnerEndpointId(sourceName) === participantId
- && sourceName.endsWith(`.${language}`));
-}
-
-/**
- * The audio-translation status treatment for a participant, combining whether translation is enabled for the
- * local user ({@link isParticipantAudioTranslationActive}) and whether translated audio is being received
- * ({@link isReceivingTranslationFrom}).
- *
- * @param {IReduxState} state - The redux state.
- * @param {string} participantId - The participant (endpoint) id to check.
- * @returns {TranslationTreatment}
- */
-export function getTranslationTreatment(state: IReduxState, participantId: string): TranslationTreatment {
- const enabled = isParticipantAudioTranslationActive(state, participantId);
- const receiving = isReceivingTranslationFrom(state, participantId);
-
- if (enabled && receiving) {
- return TranslationTreatment.BOTH;
- }
- if (enabled) {
- return TranslationTreatment.ENABLED;
- }
- if (receiving) {
- return TranslationTreatment.RECEIVING;
- }
-
- return TranslationTreatment.NONE;
-}
-
/**
* Whether audio translation is in progress in the meeting, for the conference label. Only control-plane
* signals count: languages participants declare, the listener counts speakers publish in room metadata, and
@@ -124,6 +37,17 @@ export function isAudioTranslationActiveInMeeting(state: IReduxState): boolean {
|| Object.values(listenerCounts).some(counts => Object.values(counts).some(count => count > 0));
}
+/**
+ * Whether any speaker's translated audio is currently playing out in the meeting. The bridge floods sending
+ * changes to every endpoint, so this is conference-wide rather than specific to what we subscribed to.
+ *
+ * @param {IReduxState} state - The redux state.
+ * @returns {boolean}
+ */
+export function isTranslationPlayingOut(state: IReduxState): boolean {
+ return state['features/audio-translation'].receivingSources.length > 0;
+}
+
/**
* Whether the local user may manage audio translation for the room (i.e. toggle the room-wide flag). Mirrors the
* prosody {@code live-translation} permission: the token's explicit value wins, otherwise moderators have it.
@@ -265,44 +189,3 @@ export function getDuckedVolumeForParticipant(state: IReduxState, participantId?
return typeof userVolume === 'number' ? Math.min(userVolume, duckedVolume) : duckedVolume;
}
-/**
- * The number of participants still hearing the given speaker's translated audio, as published by that
- * speaker. 0 when nothing is pending or the speaker's client does not publish the count.
- *
- * @param {IReduxState} state - The redux state.
- * @param {string} participantId - The speaker's participant id.
- * @returns {number}
- */
-export function getTranslationDeliveryPendingCount(state: IReduxState, participantId: string): number {
- const counts = state['features/base/conference'].metadata?.audioTranslationListenerCounts?.[participantId];
-
- if (!counts) {
- return 0;
- }
-
- // Sum the subscribers of only the languages the bridge is still sending for this speaker: the in-flight
- // language count alone undercounts (one source serves every listener of that language) and the speaker's
- // subscriber total overcounts (a language whose stream already finished).
- return state['features/audio-translation'].receivingSources.reduce((total, sourceName) =>
- getSourceOwnerEndpointId(sourceName) === participantId
- ? total + (counts[getSourceLanguage(sourceName)] ?? 0)
- : total, 0);
-}
-
-/**
- * Whether translated audio for the given speaker is still being delivered, so others should wait before
- * speaking. Falls back to any in-flight translated source owned by the speaker, so the ring still shows when
- * the speaker's client does not publish a count.
- *
- * @param {IReduxState} state - The redux state.
- * @param {string} participantId - The speaker's participant id.
- * @returns {boolean}
- */
-export function isTranslationDeliveryPending(state: IReduxState, participantId: string): boolean {
- if (getTranslationDeliveryPendingCount(state, participantId) > 0) {
- return true;
- }
-
- return state['features/audio-translation'].receivingSources
- .some(sourceName => getSourceOwnerEndpointId(sourceName) === participantId);
-}
diff --git a/react/features/audio-translation/reducer.ts b/react/features/audio-translation/reducer.ts
index 66cf82163e..1dd8923855 100644
--- a/react/features/audio-translation/reducer.ts
+++ b/react/features/audio-translation/reducer.ts
@@ -51,7 +51,13 @@ ReducerRegistry.register<IAudioTranslationState>(
(state = DEFAULT_STATE, action): IAudioTranslationState => {
switch (action.type) {
case CLEAR_AUDIO_TRANSLATION:
- return DEFAULT_STATE;
+ // Only the local selection. receivingSources and translationListeners are reported by the backend
+ // and describe the whole conference, so they stay until it says otherwise.
+ return {
+ ...state,
+ language: null,
+ participantLanguages: {}
+ };
case CLEAR_RECEIVING_TRANSLATED_SOURCES:
return {
...state,
@@ -71,10 +77,17 @@ ReducerRegistry.register<IAudioTranslationState>(
}
};
case PARTICIPANT_LEFT: {
- // A per-speaker choice must not outlive the speaker, or the meeting label never clears.
- const { [action.participant.id]: _left, ...participantLanguages } = state.participantLanguages;
+ // Choice and in-flight audio must not outlive the speaker: no stop event arrives for a departed
+ // endpoint, so the meeting label would never clear.
+ const { id } = action.participant;
+ const { [id]: _left, ...participantLanguages } = state.participantLanguages;
+ const receivingSources = state.receivingSources.filter(source => !source.startsWith(`${id}-`));
+
+ if (_left === undefined && receivingSources.length === state.receivingSources.length) {
+ return state;
+ }
- return _left === undefined ? state : { ...state, participantLanguages };
+ return { ...state, participantLanguages, receivingSources };
}
case SET_TRANSLATION_LISTENERS:
return {
diff --git a/react/features/base/icons/svg/constants.ts b/react/features/base/icons/svg/constants.ts
index f1ace57d20..3a56a4f771 100644
--- a/react/features/base/icons/svg/constants.ts
+++ b/react/features/base/icons/svg/constants.ts
@@ -91,6 +91,7 @@ import { default as IconStop } from './stop.svg';
import { default as IconSubtitles } from './subtitles.svg';
import { default as IconTileView } from './tile-view.svg';
import { default as IconTranscription } from './transcription.svg';
+import { default as IconTranslateWave } from './translate-wave.svg';
import { default as IconTranslate } from './translate.svg';
import { default as IconTrash } from './trash.svg';
import { default as IconUserDeleted } from './user-deleted.svg';
@@ -189,6 +190,7 @@ export const DEFAULT_ICON: Record<string, any> = {
IconRecord,
IconTranscription,
IconTranslate,
+ IconTranslateWave,
IconRecordAccount,
IconRecordContact,
IconRecordLead,
diff --git a/react/features/base/icons/svg/index.ts b/react/features/base/icons/svg/index.ts
index d16d30b6fd..a9c73a5cca 100644
--- a/react/features/base/icons/svg/index.ts
+++ b/react/features/base/icons/svg/index.ts
@@ -77,6 +77,7 @@ const {
IconRecord,
IconTranscription,
IconTranslate,
+ IconTranslateWave,
IconRecordAccount,
IconRecordContact,
IconRecordLead,
@@ -200,6 +201,7 @@ export {
IconRecord,
IconTranscription,
IconTranslate,
+ IconTranslateWave,
IconRecordAccount,
IconRecordContact,
IconRecordLead,
diff --git a/react/features/base/icons/svg/translate-wave.svg b/react/features/base/icons/svg/translate-wave.svg
new file mode 100644
index 0000000000..2c61824065
--- /dev/null
+++ b/react/features/base/icons/svg/translate-wave.svg
@@ -0,0 +1,7 @@
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <path d="M12.87 15.07l-2.54-2.51.03-.03c1.74-1.94 2.98-4.17 3.71-6.53H17V4h-7V2H8v2H1v1.99h11.17C11.5 7.92 10.44 9.75 9 11.35 8.07 10.32 7.3 9.19 6.69 8h-2c.73 1.63 1.73 3.17 2.98 4.56l-5.09 5.02L4 19l5-5 3.11 3.11.76-2.04z" />
+ <rect x="15.4" y="12" width="1.2" height="5" rx="0.6" />
+ <rect x="17.6" y="9.75" width="1.2" height="9.5" rx="0.6" />
+ <rect x="19.8" y="11" width="1.2" height="7" rx="0.6" />
+ <rect x="22" y="12.75" width="1.2" height="3.5" rx="0.6" />
+</svg>
diff --git a/react/features/base/ui/Tokens.ts b/react/features/base/ui/Tokens.ts
index 9d694615be..4c40fe76ce 100644
--- a/react/features/base/ui/Tokens.ts
+++ b/react/features/base/ui/Tokens.ts
@@ -554,6 +554,7 @@ export const colorMap = {
// Warning
warning01: 'warning01',
warning02: 'warning06',
+ warning03: 'warning03',
// ----- Support -----
diff --git a/react/features/base/ui/types.ts b/react/features/base/ui/types.ts
index a8be2a5a37..8d5797c34b 100644
--- a/react/features/base/ui/types.ts
+++ b/react/features/base/ui/types.ts
@@ -60,6 +60,7 @@ export interface IPalette {
uiBackground: string;
warning01: string;
warning02: string;
+ warning03: string;
// Semantic tokens (component-based, more descriptive names)
breakoutRoomArrowBackground: string;
diff --git a/react/features/filmstrip/components/native/Thumbnail.tsx b/react/features/filmstrip/components/native/Thumbnail.tsx
index 9ed4dc63b3..da59295b49 100644
--- a/react/features/filmstrip/components/native/Thumbnail.tsx
+++ b/react/features/filmstrip/components/native/Thumbnail.tsx
@@ -3,8 +3,6 @@ import { Image, ImageStyle, View, ViewStyle } from 'react-native';
import { connect } from 'react-redux';
import { IReduxState, IStore } from '../../../app/types';
-import { TranslationTreatment } from '../../../audio-translation/constants';
-import { getTranslationTreatment, isAudioTranslationAvailable } from '../../../audio-translation/functions';
import { MEDIA_TYPE, VIDEO_TYPE } from '../../../base/media/constants';
import { pinParticipant } from '../../../base/participants/actions';
import ParticipantView from '../../../base/participants/components/ParticipantView.native';
@@ -43,7 +41,6 @@ import ModeratorIndicator from './ModeratorIndicator';
import PinnedIndicator from './PinnedIndicator';
import RaisedHandIndicator from './RaisedHandIndicator';
import ScreenShareIndicator from './ScreenShareIndicator';
-import TranslationIndicator from './TranslationIndicator';
import styles, { AVATAR_SIZE } from './styles';
@@ -117,11 +114,6 @@ interface IProps {
_shouldDisplayTileView: boolean;
- /**
- * The audio-translation treatment to render for this participant (NONE renders no indicator).
- */
- _translationTreatment: TranslationTreatment;
-
/**
* The video track that will be displayed in the thumbnail.
*/
@@ -228,7 +220,6 @@ class Thumbnail extends PureComponent<IProps> {
_participantId: participantId,
_pinned,
_renderModeratorIndicator: renderModeratorIndicator,
- _translationTreatment: translationTreatment,
_shouldDisplayTileView,
renderDisplayName,
tileView
@@ -239,8 +230,7 @@ class Thumbnail extends PureComponent<IProps> {
if (_shouldDisplayTileView) {
bottomIndicatorsContainerStyle = styles.bottomIndicatorsContainer;
- } else if (audioMuted || renderModeratorIndicator
- || translationTreatment !== TranslationTreatment.NONE) {
+ } else if (audioMuted || renderModeratorIndicator) {
bottomIndicatorsContainerStyle = styles.bottomIndicatorsContainer;
} else {
bottomIndicatorsContainerStyle = null;
@@ -264,8 +254,6 @@ class Thumbnail extends PureComponent<IProps> {
<Container
style = { bottomIndicatorsContainerStyle as StyleType }>
{ audioMuted && !_isVirtualScreenshare && <AudioMutedIndicator /> }
- { translationTreatment !== TranslationTreatment.NONE
- && <TranslationIndicator treatment = { translationTreatment } /> }
{ !tileView && _pinned && <PinnedIndicator />}
{ renderModeratorIndicator && !_isVirtualScreenshare && <ModeratorIndicator />}
{ !tileView && (isScreenShare || _isVirtualScreenshare) && <ScreenShareIndicator /> }
@@ -366,10 +354,6 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
const _isEveryoneModerator = isEveryoneModerator(state);
const renderModeratorIndicator = tileView && !_isEveryoneModerator
&& participant?.role === PARTICIPANT_ROLE.MODERATOR;
- const translationTreatment = !participant?.local && !isScreenShareParticipant(participant)
- && isAudioTranslationAvailable(state)
- ? getTranslationTreatment(state, id ?? '')
- : TranslationTreatment.NONE;
const { gifUrl: gifSrc } = getGifForParticipant(state, id ?? '');
const mode = getGifDisplayMode(state);
@@ -386,7 +370,6 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
_raisedHand: hasRaisedHand(participant),
_renderDominantSpeakerIndicator: renderDominantSpeakerIndicator,
_renderModeratorIndicator: renderModeratorIndicator,
- _translationTreatment: translationTreatment,
_shouldDisplayTileView: shouldDisplayTileView(state),
_videoTrack: videoTrack
};
diff --git a/react/features/filmstrip/components/native/TranslationIndicator.tsx b/react/features/filmstrip/components/native/TranslationIndicator.tsx
deleted file mode 100644
index 68a8c6c913..0000000000
--- a/react/features/filmstrip/components/native/TranslationIndicator.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import React from 'react';
-import { StyleProp, View, ViewStyle } from 'react-native';
-
-import { TranslationTreatment } from '../../../audio-translation/constants';
-import { IconTranslate } from '../../../base/icons/svg';
-import BaseIndicator from '../../../base/react/components/native/BaseIndicator';
-import BaseTheme from '../../../base/ui/components/BaseTheme.native';
-
-import styles from './styles';
-
-interface IProps {
-
- /**
- * Which of the three treatments to render.
- */
- treatment: TranslationTreatment;
-}
-
-/**
- * Thumbnail badge for a participant's translation status: outlined (enabled), filled (receiving), dot (both).
- *
- * @param {IProps} props - The component's props.
- * @returns {ReactElement}
- */
-const TranslationIndicator = ({ treatment }: IProps) => {
- const outlined = treatment === TranslationTreatment.ENABLED;
-
- return (
- <View
- style = { (outlined
- ? styles.translationIndicatorOutlined
- : styles.translationIndicatorFilled) as StyleProp<ViewStyle> }>
- <BaseIndicator
- icon = { IconTranslate }
- iconStyle = { outlined ? { color: BaseTheme.palette.action01 } : {} } />
- { treatment === TranslationTreatment.BOTH
- && <View style = { styles.translationIndicatorDot as StyleProp<ViewStyle> } /> }
- </View>
- );
-};
-
-export default TranslationIndicator;
diff --git a/react/features/filmstrip/components/web/StatusIndicators.tsx b/react/features/filmstrip/components/web/StatusIndicators.tsx
index d534499e07..f16cfb5f04 100644
--- a/react/features/filmstrip/components/web/StatusIndicators.tsx
+++ b/react/features/filmstrip/components/web/StatusIndicators.tsx
@@ -15,7 +15,6 @@ import { getIndicatorsTooltipPosition } from '../../functions.web';
import AudioMutedIndicator from './AudioMutedIndicator';
import ModeratorIndicator from './ModeratorIndicator';
import ScreenShareIndicator from './ScreenShareIndicator';
-import TranslationIndicator from './TranslationIndicator';
/**
* The type of the React {@code Component} props of {@link StatusIndicators}.
@@ -37,11 +36,6 @@ interface IProps {
*/
_showScreenShareIndicator: Boolean;
- /**
- * Indicates if the translation indicator should be visible or not.
- */
- _showTranslationIndicator: Boolean;
-
/**
* The ID of the participant for which the status bar is rendered.
*/
@@ -70,8 +64,6 @@ class StatusIndicators extends Component<IProps> {
_showAudioMutedIndicator,
_showModeratorIndicator,
_showScreenShareIndicator,
- _showTranslationIndicator,
- participantID,
thumbnailType
} = this.props;
const tooltipPosition = getIndicatorsTooltipPosition(thumbnailType);
@@ -80,9 +72,6 @@ class StatusIndicators extends Component<IProps> {
<>
{ _showAudioMutedIndicator && <AudioMutedIndicator tooltipPosition = { tooltipPosition } /> }
{ _showModeratorIndicator && <ModeratorIndicator tooltipPosition = { tooltipPosition } />}
- { _showTranslationIndicator && <TranslationIndicator
- participantId = { participantID }
- tooltipPosition = { tooltipPosition } /> }
{ _showScreenShareIndicator && <ScreenShareIndicator tooltipPosition = { tooltipPosition } /> }
</>
);
@@ -98,12 +87,11 @@ class StatusIndicators extends Component<IProps> {
* @returns {{
* _showAudioMutedIndicator: boolean,
* _showModeratorIndicator: boolean,
- * _showScreenShareIndicator: boolean,
- * _showTranslationIndicator: boolean
+ * _showScreenShareIndicator: boolean
* }}
*/
function _mapStateToProps(state: IReduxState, ownProps: any) {
- const { participantID, audio, moderator, screenshare, translation } = ownProps;
+ const { participantID, audio, moderator, screenshare } = ownProps;
// Only the local participant won't have id for the time when the conference is not yet joined.
const participant = getParticipantByIdOrUndefined(state, participantID);
@@ -128,8 +116,7 @@ function _mapStateToProps(state: IReduxState, ownProps: any) {
_showAudioMutedIndicator: isAudioMuted && audio,
_showModeratorIndicator:
!disableModeratorIndicator && participant && participant.role === PARTICIPANT_ROLE.MODERATOR && moderator,
- _showScreenShareIndicator: isScreenSharing && screenshare,
- _showTranslationIndicator: Boolean(translation)
+ _showScreenShareIndicator: isScreenSharing && screenshare
};
}
diff --git a/react/features/filmstrip/components/web/Thumbnail.tsx b/react/features/filmstrip/components/web/Thumbnail.tsx
index 5c5ea428fb..58493c0aba 100644
--- a/react/features/filmstrip/components/web/Thumbnail.tsx
+++ b/react/features/filmstrip/components/web/Thumbnail.tsx
@@ -4,13 +4,11 @@ import { debounce } from 'lodash-es';
import React, { Component, KeyboardEvent, RefObject, createRef } from 'react';
import { WithTranslation } from 'react-i18next';
import { connect } from 'react-redux';
-import { keyframes } from 'tss-react';
import { withStyles } from 'tss-react/mui';
import { createScreenSharingIssueEvent } from '../../../analytics/AnalyticsEvents';
import { sendAnalytics } from '../../../analytics/functions';
import { IReduxState, IStore } from '../../../app/types';
-import { isTranslationDeliveryPending } from '../../../audio-translation/functions';
import Avatar from '../../../base/avatar/components/Avatar';
import { isMobileBrowser } from '../../../base/environment/utils';
import { translate } from '../../../base/i18n/functions';
@@ -65,7 +63,6 @@ import {
import ThumbnailAudioIndicator from './ThumbnailAudioIndicator';
import ThumbnailBottomIndicators from './ThumbnailBottomIndicators';
import ThumbnailTopIndicators from './ThumbnailTopIndicators';
-import TranslationPendingChip from './TranslationPendingChip';
import VirtualScreenshareParticipant from './VirtualScreenshareParticipant';
/**
@@ -214,12 +211,6 @@ export interface IProps extends WithTranslation {
*/
_thumbnailType: string;
- /**
- * Whether translated audio from this participant is still reaching other participants, so anyone about to
- * speak should wait. Takes precedence over the dominant-speaker ring.
- */
- _translationDeliveryPending: boolean;
-
/**
* The video object position for the participant.
*/
@@ -360,29 +351,6 @@ const defaultStyles = (theme: Theme) => {
}
},
- translationPending: {
- '& .translation-pending-border': {
- animation: `${keyframes`
- 0% {
- opacity: 0.45;
- }
- 50% {
- opacity: 1;
- }
- 100% {
- opacity: 0.45;
- }
- `} 1.6s ease-in-out infinite`,
- outline: '3px dashed #F8AE1A',
- outlineOffset: '-1.5px',
-
- '@media (prefers-reduced-motion: reduce)': {
- animation: 'none',
- opacity: 0.85
- }
- }
- },
-
raisedHand: {
'& .raised-hand-border': {
boxShadow: `inset 0px 0px 0px 2px ${theme.palette.warning02} !important`
@@ -950,10 +918,7 @@ class Thumbnail extends Component<IProps, IState> {
className += ` ${classes.raisedHand}`;
}
- if (this.props._translationDeliveryPending) {
- // Others are still hearing this speaker translated; this ring replaces the dominant-speaker one.
- className += ` ${classes.translationPending}`;
- } else if (!_isDominantSpeakerDisabled && _participant?.dominantSpeaker) {
+ if (!_isDominantSpeakerDisabled && _participant?.dominantSpeaker) {
className += ` ${classes.activeSpeaker} dominant-speaker`;
}
if (_thumbnailType !== THUMBNAIL_TYPE.TILE && _participant?.pinned) {
@@ -1152,13 +1117,6 @@ class Thumbnail extends Component<IProps, IState> {
className = { clsx(classes.borderIndicator,
_gifSrc && classes.borderIndicatorOnTop,
'active-speaker-indicator') } />
- <div
- className = { clsx(classes.borderIndicator,
- _gifSrc && classes.borderIndicatorOnTop,
- 'translation-pending-border') } />
- <TranslationPendingChip
- participantId = { id }
- thumbnailType = { _thumbnailType } />
{_gifSrc && (
<div
className = { clsx(classes.borderIndicator, classes.borderIndicatorOnTop) }
@@ -1395,7 +1353,6 @@ function _mapStateToProps(state: IReduxState, ownProps: any): Object {
_stageFilmstripLayout: isStageFilmstripAvailable(state),
_stageParticipantsVisible: _currentLayout === LAYOUTS.STAGE_FILMSTRIP_VIEW,
_shouldDisplayTintBackground: !disableTintForeground && shouldDisplayTintBackground,
- _translationDeliveryPending: isTranslationDeliveryPending(state, id),
_thumbnailType: tileType,
_videoObjectPosition: getVideoObjectPosition(state, participant?.id),
_videoTrack,
diff --git a/react/features/filmstrip/components/web/ThumbnailBottomIndicators.tsx b/react/features/filmstrip/components/web/ThumbnailBottomIndicators.tsx
index 7992f75f9a..48c1e26a15 100644
--- a/react/features/filmstrip/components/web/ThumbnailBottomIndicators.tsx
+++ b/react/features/filmstrip/components/web/ThumbnailBottomIndicators.tsx
@@ -76,8 +76,7 @@ const ThumbnailBottomIndicators = ({
moderator = { true }
participantID = { participantId }
screenshare = { isVirtualScreenshareParticipant }
- thumbnailType = { thumbnailType }
- translation = { !local && !isVirtualScreenshareParticipant } />
+ thumbnailType = { thumbnailType } />
}
{
_showDisplayName && (
diff --git a/react/features/filmstrip/components/web/TranslationIndicator.tsx b/react/features/filmstrip/components/web/TranslationIndicator.tsx
deleted file mode 100644
index 31227c5611..0000000000
--- a/react/features/filmstrip/components/web/TranslationIndicator.tsx
+++ /dev/null
@@ -1,118 +0,0 @@
-import React from 'react';
-import { connect } from 'react-redux';
-import { makeStyles } from 'tss-react/mui';
-
-import { IReduxState } from '../../../app/types';
-import { TranslationTreatment } from '../../../audio-translation/constants';
-import { getTranslationTreatment } from '../../../audio-translation/functions';
-import { IconTranslate } from '../../../base/icons/svg';
-import BaseIndicator from '../../../base/react/components/web/BaseIndicator';
-import { TOOLTIP_POSITION } from '../../../base/ui/constants.any';
-
-/**
- * The type of the React {@code Component} props of {@link TranslationIndicator}.
- */
-interface IProps {
-
- /**
- * Which of the three treatments to render, or NONE to render nothing.
- */
- _treatment: TranslationTreatment;
-
- /**
- * The id of the participant this indicator is rendered for.
- */
- participantId: string;
-
- /**
- * From which side of the indicator the tooltip should appear from.
- */
- tooltipPosition: TOOLTIP_POSITION;
-}
-
-/**
- * Tooltip i18n key per rendered treatment.
- */
-const TOOLTIP_KEYS: Record<TranslationTreatment, string> = {
- [TranslationTreatment.BOTH]: 'videothumbnail.translationOnAndReceiving',
- [TranslationTreatment.ENABLED]: 'videothumbnail.translationEnabledForYou',
- [TranslationTreatment.NONE]: '',
- [TranslationTreatment.RECEIVING]: 'videothumbnail.receivingTranslatedAudio'
-};
-
-const useStyles = makeStyles()(theme => {
- return {
- dot: {
- backgroundColor: theme.palette.icon01,
- border: `1px solid ${theme.palette.uiBackground}`,
- borderRadius: '50%',
- height: '5px',
- position: 'absolute',
- right: '-1px',
- top: '-1px',
- width: '5px'
- },
- filled: {
- backgroundColor: theme.palette.action01,
- borderRadius: '4px',
- boxSizing: 'border-box',
- display: 'inline-block',
- padding: '4px',
- position: 'relative'
- },
- outlined: {
- border: `1px solid ${theme.palette.action01}`,
- borderRadius: '4px',
- boxSizing: 'border-box',
- display: 'inline-block',
- padding: '3px'
- }
- };
-});
-
-/**
- * React {@code Component} showing a participant's audio-translation status as one of three treatments: outlined
- * (translation enabled for the local user), filled (receiving translated audio) or filled with a dot (both).
- * Renders nothing when neither applies.
- *
- * @param {IProps} props - The component's props.
- * @returns {ReactElement|null}
- */
-const TranslationIndicator = ({ _treatment, tooltipPosition }: IProps) => {
- const { classes: styles, theme } = useStyles();
-
- if (_treatment === TranslationTreatment.NONE) {
- return null;
- }
-
- const outlined = _treatment === TranslationTreatment.ENABLED;
-
- return (
- <div className = { outlined ? styles.outlined : styles.filled }>
- <BaseIndicator
- icon = { IconTranslate }
- iconColor = { outlined ? theme.palette.action01 : theme.palette.icon01 }
- iconId = 'translation-active'
- iconSize = { 16 }
- id = 'translationActive'
- tooltipKey = { TOOLTIP_KEYS[_treatment] }
- tooltipPosition = { tooltipPosition } />
- { _treatment === TranslationTreatment.BOTH && <span className = { styles.dot } /> }
- </div>
- );
-};
-
-/**
- * Maps (parts of) the redux state to the component's props.
- *
- * @param {IReduxState} state - The redux state.
- * @param {Object} ownProps - The component's own props.
- * @returns {Object}
- */
-function _mapStateToProps(state: IReduxState, ownProps: any) {
- return {
- _treatment: getTranslationTreatment(state, ownProps.participantId)
- };
-}
-
-export default connect(_mapStateToProps)(TranslationIndicator);
diff --git a/react/features/filmstrip/components/web/TranslationPendingChip.tsx b/react/features/filmstrip/components/web/TranslationPendingChip.tsx
deleted file mode 100644
index 5e222344df..0000000000
--- a/react/features/filmstrip/components/web/TranslationPendingChip.tsx
+++ /dev/null
@@ -1,113 +0,0 @@
-import React from 'react';
-import { useTranslation } from 'react-i18next';
-import { useSelector } from 'react-redux';
-import { keyframes } from 'tss-react';
-import { makeStyles } from 'tss-react/mui';
-
-import { IReduxState } from '../../../app/types';
-import { getTranslationDeliveryPendingCount } from '../../../audio-translation/functions';
-import { THUMBNAIL_TYPE } from '../../constants';
-
-/**
- * Amber, deliberately not the dominant-speaker blue.
- */
-const PENDING_COLOR = '#F8AE1A';
-
-interface IProps {
-
- /**
- * The speaker whose translated audio is still being delivered.
- */
- participantId: string;
-
- /**
- * The type of thumbnail; drives the compact (count-only) form.
- */
- thumbnailType?: string;
-}
-
-const useStyles = makeStyles()(() => {
- const breathe = keyframes`
- 0% { opacity: 0.45; }
- 50% { opacity: 1; }
- 100% { opacity: 0.45; }
- `;
-
- return {
- chip: {
- alignItems: 'center',
- backgroundColor: 'rgba(0, 0, 0, 0.72)',
- border: `1px solid ${PENDING_COLOR}`,
- borderRadius: '12px',
- color: '#FFD98A',
- display: 'flex',
- gap: '4px',
- padding: '2px 6px',
- position: 'absolute' as const,
- right: '4px',
- top: '4px',
- whiteSpace: 'nowrap' as const,
- zIndex: 12
- },
-
- compact: {
- fontSize: '9px',
- lineHeight: '12px'
- },
-
- dot: {
- animation: `${breathe} 1.6s ease-in-out infinite`,
- backgroundColor: PENDING_COLOR,
- borderRadius: '50%',
- flexShrink: 0,
- height: '8px',
- width: '8px',
-
- '@media (prefers-reduced-motion: reduce)': {
- animation: 'none',
- opacity: 0.85
- }
- },
-
- label: {
- fontSize: '10px',
- lineHeight: '13px'
- }
- };
-});
-
-/**
- * Corner chip counting the participants still hearing this speaker's translated audio. Renders nothing when
- * no count was published (the ring alone still signals the wait).
- *
- * @param {IProps} props - The component's props.
- * @returns {ReactElement|null}
- */
-const TranslationPendingChip = ({ participantId, thumbnailType }: IProps) => {
- const { classes, cx } = useStyles();
- const { t } = useTranslation();
- const count = useSelector((state: IReduxState) =>
- getTranslationDeliveryPendingCount(state, participantId));
-
- if (count < 1) {
- return null;
- }
-
- const isCompact = thumbnailType !== THUMBNAIL_TYPE.TILE;
- const tooltip = t('videothumbnail.translationStillListening', { count });
- const label = t('videothumbnail.translationStillListeningShort', { num: count });
-
- return (
- <div
- aria-label = { tooltip }
- className = { cx(classes.chip, isCompact && classes.compact) }
- title = { tooltip }>
- <span className = { classes.dot } />
- <span className = { classes.label }>
- { isCompact ? count : label }
- </span>
- </div>
- );
-};
-
-export default TranslationPendingChip;