setSourceToPresent(selectedSource)}
source={source}
@@ -111,6 +115,7 @@ export const CallingSelectPresentingSourcesModal = ({
{sources.false.map(source => (
setSourceToPresent(selectedSource)}
source={source}
diff --git a/ts/services/calling.ts b/ts/services/calling.ts
index cef72d3ed1..36269eec58 100644
--- a/ts/services/calling.ts
+++ b/ts/services/calling.ts
@@ -48,6 +48,7 @@ import {
PresentableSource,
PresentedSource,
} from '../types/Calling';
+import { LocalizerType } from '../types/Util';
import { ConversationModel } from '../models/conversations';
import {
base64ToArrayBuffer,
@@ -89,6 +90,33 @@ enum GroupCallUpdateMessageState {
SentLeft,
}
+export function isScreenSource(source: PresentedSource): boolean {
+ return source.id.startsWith('screen');
+}
+
+export function translateSourceName(
+ i18n: LocalizerType,
+ source: PresentedSource
+): string {
+ const { name } = source;
+ if (!isScreenSource(source)) {
+ return name;
+ }
+
+ if (name === 'Entire Screen') {
+ return i18n('calling__SelectPresentingSourcesModal--entireScreen');
+ }
+
+ const match = name.match(/^Screen (\d+)$/);
+ if (match) {
+ return i18n('calling__SelectPresentingSourcesModal--screen', {
+ id: match[1],
+ });
+ }
+
+ return name;
+}
+
export class CallingClass {
readonly videoCapturer: GumVideoCapturer;
@@ -954,7 +982,10 @@ export class CallingClass {
this.setOutgoingVideoIsScreenShare(call, isPresenting);
if (source) {
- ipcRenderer.send('show-screen-share', source.name);
+ ipcRenderer.send(
+ 'show-screen-share',
+ translateSourceName(window.i18n, source)
+ );
notify({
icon: 'images/icons/v2/video-solid-24.svg',
message: window.i18n('calling__presenting--notification-body'),