mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2026-04-24 18:38:15 +01:00
Rename files
This commit is contained in:
35
ts/util/getStringForProfileChange.std.ts
Normal file
35
ts/util/getStringForProfileChange.std.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
// Copyright 2020 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type { LocalizerType } from '../types/Util.std.js';
|
||||
|
||||
export type ProfileNameChangeType = {
|
||||
type: 'name';
|
||||
oldName: string;
|
||||
newName: string;
|
||||
};
|
||||
type ContactType = {
|
||||
title: string;
|
||||
name?: string;
|
||||
};
|
||||
|
||||
export function getStringForProfileChange(
|
||||
change: ProfileNameChangeType,
|
||||
changedContact: ContactType,
|
||||
i18n: LocalizerType
|
||||
): string {
|
||||
if (change.type === 'name') {
|
||||
return changedContact.name
|
||||
? i18n('icu:contactChangedProfileName', {
|
||||
sender: changedContact.title,
|
||||
oldProfile: change.oldName,
|
||||
newProfile: change.newName,
|
||||
})
|
||||
: i18n('icu:changedProfileName', {
|
||||
oldProfile: change.oldName,
|
||||
newProfile: change.newName,
|
||||
});
|
||||
}
|
||||
|
||||
throw new Error('TimelineItem: Unknown type!');
|
||||
}
|
||||
Reference in New Issue
Block a user