mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-25 04:36:46 +00:00
GroupNotification: Fix 'joined group' pluralization (#4380)
This commit is contained in:
@@ -179,6 +179,29 @@ const stories: Array<GroupNotificationStory> = [
|
||||
],
|
||||
i18n,
|
||||
},
|
||||
{
|
||||
from: {
|
||||
name: 'Alice',
|
||||
phoneNumber: '(202) 555-1000',
|
||||
},
|
||||
changes: [
|
||||
{
|
||||
type: 'add',
|
||||
contacts: [
|
||||
{
|
||||
phoneNumber: '(202) 555-1000',
|
||||
profileName: 'Mr. Fire',
|
||||
isMe: true,
|
||||
},
|
||||
{
|
||||
phoneNumber: '(202) 555-1001',
|
||||
profileName: 'Mrs. Ice',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
i18n,
|
||||
},
|
||||
],
|
||||
],
|
||||
[
|
||||
|
||||
@@ -75,35 +75,25 @@ export class GroupNotification extends React.Component<Props> {
|
||||
throw new Error('Group update is missing contacts');
|
||||
}
|
||||
|
||||
if (contacts.length === 1) {
|
||||
if (contactsIncludesMe) {
|
||||
return <Intl i18n={i18n} id="youJoinedTheGroup" />;
|
||||
} else {
|
||||
return (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id="joinedTheGroup"
|
||||
components={[otherPeopleWithCommas]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const joinedKey =
|
||||
contacts.length > 1 ? 'multipleJoinedTheGroup' : 'joinedTheGroup';
|
||||
const otherPeopleNotifMsg =
|
||||
otherPeople.length === 1
|
||||
? 'joinedTheGroup'
|
||||
: 'multipleJoinedTheGroup';
|
||||
|
||||
return (
|
||||
<>
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id={joinedKey}
|
||||
components={[otherPeopleWithCommas]}
|
||||
/>
|
||||
{contactsIncludesMe ? (
|
||||
{otherPeople.length > 0 && (
|
||||
<Intl
|
||||
i18n={i18n}
|
||||
id={otherPeopleNotifMsg}
|
||||
components={[otherPeopleWithCommas]}
|
||||
/>
|
||||
)}
|
||||
{contactsIncludesMe && (
|
||||
<div className="module-group-notification__change">
|
||||
<Intl i18n={i18n} id="youJoinedTheGroup" />
|
||||
</div>
|
||||
) : null}
|
||||
)}
|
||||
</>
|
||||
);
|
||||
case 'remove':
|
||||
|
||||
Reference in New Issue
Block a user