2022-12-05 22:46:54 +00:00
|
|
|
// Copyright 2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import type { LocalizerType } from '../types/Util';
|
|
|
|
|
|
|
|
export function getStringForConversationMerge({
|
|
|
|
obsoleteConversationTitle,
|
2023-01-12 22:18:08 +00:00
|
|
|
obsoleteConversationNumber,
|
2022-12-05 22:46:54 +00:00
|
|
|
conversationTitle,
|
|
|
|
i18n,
|
|
|
|
}: {
|
|
|
|
obsoleteConversationTitle: string | undefined;
|
2023-01-12 22:18:08 +00:00
|
|
|
obsoleteConversationNumber: string | undefined;
|
2022-12-05 22:46:54 +00:00
|
|
|
conversationTitle: string;
|
|
|
|
i18n: LocalizerType;
|
|
|
|
}): string {
|
|
|
|
if (!obsoleteConversationTitle) {
|
2023-01-12 22:18:08 +00:00
|
|
|
return i18n('icu:ConversationMerge--notification--no-title', {
|
2022-12-05 22:46:54 +00:00
|
|
|
conversationTitle,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2023-01-12 22:18:08 +00:00
|
|
|
if (obsoleteConversationNumber) {
|
|
|
|
return i18n('icu:ConversationMerge--notification--with-e164', {
|
|
|
|
conversationTitle,
|
|
|
|
obsoleteConversationNumber,
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2022-12-05 22:46:54 +00:00
|
|
|
return i18n('icu:ConversationMerge--notification', {
|
|
|
|
obsoleteConversationTitle,
|
|
|
|
conversationTitle,
|
|
|
|
});
|
|
|
|
}
|