mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-21 08:58:19 +01:00
Remove window.i18n in favor of SignalContext.i18n
This commit is contained in:
@@ -8,6 +8,8 @@ import { hydrateRanges } from '../types/BodyRange.js';
|
||||
import { isVoiceMessage } from './Attachment.js';
|
||||
import { stripNewlinesForLeftPane } from './stripNewlinesForLeftPane.js';
|
||||
|
||||
const { i18n } = window.SignalContext;
|
||||
|
||||
export function getDraftPreview(
|
||||
attributes: ConversationAttributesType
|
||||
): DraftPreviewType {
|
||||
@@ -27,23 +29,23 @@ export function getDraftPreview(
|
||||
if (draftAttachments.length > 0) {
|
||||
if (isVoiceMessage(draftAttachments[0])) {
|
||||
return {
|
||||
text: window.i18n('icu:message--getNotificationText--voice-message'),
|
||||
text: i18n('icu:message--getNotificationText--voice-message'),
|
||||
prefix: '🎤',
|
||||
};
|
||||
}
|
||||
return {
|
||||
text: window.i18n('icu:Conversation--getDraftPreview--attachment'),
|
||||
text: i18n('icu:Conversation--getDraftPreview--attachment'),
|
||||
};
|
||||
}
|
||||
|
||||
const { quotedMessageId } = attributes;
|
||||
if (quotedMessageId) {
|
||||
return {
|
||||
text: window.i18n('icu:Conversation--getDraftPreview--quote'),
|
||||
text: i18n('icu:Conversation--getDraftPreview--quote'),
|
||||
};
|
||||
}
|
||||
|
||||
return {
|
||||
text: window.i18n('icu:Conversation--getDraftPreview--draft'),
|
||||
text: i18n('icu:Conversation--getDraftPreview--draft'),
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user