Fix message for an ongoing group call with three people
There's no reason to special-case "three" vs "four or more" in our current format (rather than using "three or more"), and in fact the "three" case wasn't using correct English (it was correct in the PluralAware table, though). Update both the in-call title text and the conversation item to use the PluralAware "many" version for "three or more" people in a call.
This commit is contained in:
parent
c517b0406b
commit
e5e4e4b2bf
@ -224,12 +224,6 @@ class CallHeader: UIView {
|
||||
comment: "Text explaining that there are two people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2 }}"
|
||||
)
|
||||
callTitleText = String(format: formatString, memberNames[0], memberNames[1])
|
||||
case 3:
|
||||
let formatString = NSLocalizedString(
|
||||
"GROUP_CALL_THREE_PEOPLE_HERE_FORMAT",
|
||||
comment: "Text explaining that there are three people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2 }}"
|
||||
)
|
||||
callTitleText = String(format: formatString, memberNames[0], memberNames[1])
|
||||
default:
|
||||
let formatString = NSLocalizedString(
|
||||
"GROUP_CALL_MANY_PEOPLE_HERE_%d", tableName: "PluralAware",
|
||||
|
||||
@ -2242,9 +2242,6 @@
|
||||
/* Button to leave a group call */
|
||||
"GROUP_CALL_LEAVE_BUTTON" = "Leave Call";
|
||||
|
||||
/* Text explaining that there are more than three people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2, %3$@ participantCount-2 }} */
|
||||
"GROUP_CALL_MANY_PEOPLE_HERE_FORMAT" = "%1$@, %2$@, and %3$@ others are in this call";
|
||||
|
||||
/* String displayed in cell when media from a user can't be displayed in group call grid. Embeds {user's name} */
|
||||
"GROUP_CALL_MISSING_MEDIA_KEYS_FORMAT" = "Can't receive audio & video from %@";
|
||||
|
||||
@ -2305,9 +2302,6 @@
|
||||
/* Text explaining that someone started a group call. Embeds {{call creator display name}} */
|
||||
"GROUP_CALL_STARTED_MESSAGE_FORMAT" = "%@ started a group call";
|
||||
|
||||
/* Text explaining that there are three people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2 }} */
|
||||
"GROUP_CALL_THREE_PEOPLE_HERE_FORMAT" = "%1$@, %2$@, and 1 other is in this call";
|
||||
|
||||
/* Text explaining that there are two people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2 }} */
|
||||
"GROUP_CALL_TWO_PEOPLE_HERE_FORMAT" = "%1$@ and %2$@ are in this call";
|
||||
|
||||
|
||||
@ -167,12 +167,11 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
- (NSString *)systemTextWithTransaction:(SDSAnyReadTransaction *)transaction
|
||||
{
|
||||
NSString *moreThanThreeFormat = OWSLocalizedString(@"GROUP_CALL_MANY_PEOPLE_HERE_FORMAT",
|
||||
@"Text explaining that there are more than three people in the group call. Embeds {{ %1$@ participant1, %2$@ "
|
||||
@"participant2, %3$@ participantCount-2 }}");
|
||||
NSString *threeFormat = OWSLocalizedString(@"GROUP_CALL_THREE_PEOPLE_HERE_FORMAT",
|
||||
@"Text explaining that there are three people in the group call. Embeds {{ %1$@ participant1, %2$@ "
|
||||
@"participant2 }}");
|
||||
NSString *threeOrMoreFormat = NSLocalizedStringFromTableInBundle(@"GROUP_CALL_MANY_PEOPLE_HERE_%d",
|
||||
@"PluralAware",
|
||||
NSBundle.mainBundle.appBundle,
|
||||
@"Text explaining that there are three or more people in the group call. Embeds {{ %1$@ participantCount-2, "
|
||||
@"%2$@ participant1, %3$@ participant2 }}");
|
||||
NSString *twoFormat = OWSLocalizedString(@"GROUP_CALL_TWO_PEOPLE_HERE_FORMAT",
|
||||
@"Text explaining that there are two people in the group call. Embeds {{ %1$@ participant1, %2$@ participant2 "
|
||||
@"}}");
|
||||
@ -209,16 +208,10 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
if (self.hasEnded) {
|
||||
return endedString;
|
||||
|
||||
} else if (sortedAddresses.count >= 4) {
|
||||
} else if (sortedAddresses.count >= 3) {
|
||||
NSString *firstName = [self participantNameForAddress:sortedAddresses[0] transaction:transaction];
|
||||
NSString *secondName = [self participantNameForAddress:sortedAddresses[1] transaction:transaction];
|
||||
NSString *remainingCount = [OWSFormat formatInt:(sortedAddresses.count - 2)];
|
||||
return [NSString stringWithFormat:moreThanThreeFormat, firstName, secondName, remainingCount];
|
||||
|
||||
} else if (sortedAddresses.count == 3) {
|
||||
NSString *firstName = [self participantNameForAddress:sortedAddresses[0] transaction:transaction];
|
||||
NSString *secondName = [self participantNameForAddress:sortedAddresses[1] transaction:transaction];
|
||||
return [NSString stringWithFormat:threeFormat, firstName, secondName];
|
||||
return [NSString localizedStringWithFormat:threeOrMoreFormat, sortedAddresses.count - 2, firstName, secondName];
|
||||
|
||||
} else if (sortedAddresses.count == 2) {
|
||||
NSString *firstName = [self participantNameForAddress:sortedAddresses[0] transaction:transaction];
|
||||
|
||||
Loading…
Reference in New Issue
Block a user