Skip to content

Commit

Permalink
Mark "Empty Room ...." strings for translation
Browse files Browse the repository at this point in the history
  • Loading branch information
aman-godara committed Mar 12, 2022
1 parent 17f3920 commit 9259cf0
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/models/room.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2416,7 +2416,7 @@ export class Room extends TypedEventEmitter<EmittedEvents, RoomEventHandlerMap>
}

if (inviteJoinCount) {
return memberNamesToRoomName(otherNames, inviteJoinCount);
return _td(memberNamesToRoomName(otherNames, inviteJoinCount));
}

const myMembership = this.getMyMembership();
Expand All @@ -2431,7 +2431,7 @@ export class Room extends TypedEventEmitter<EmittedEvents, RoomEventHandlerMap>
return i.getContent().display_name;
});

return `Inviting ${memberNamesToRoomName(thirdPartyNames)}`;
return _td(`Inviting ${memberNamesToRoomName(thirdPartyNames)}`);
}
}
// let's try to figure out who was here before
Expand All @@ -2445,9 +2445,9 @@ export class Room extends TypedEventEmitter<EmittedEvents, RoomEventHandlerMap>
}).map((m) => m.name);
}
if (leftNames.length) {
return `Empty room (was ${memberNamesToRoomName(leftNames)})`;
return _td(`Empty room (was ${memberNamesToRoomName(leftNames)})`);
} else {
return "Empty room";
return _td("Empty room");
}
}

Expand Down Expand Up @@ -2647,15 +2647,15 @@ function memberNamesToRoomName(names: string[], count = (names.length + 1)) {
if (!names.length) {
return "Empty room";
} else if (names.length === 1 && countWithoutMe <= 1) {
return names[0];
return `%(${names[0]})`;
} else if (names.length === 2 && countWithoutMe <= 2) {
return `${names[0]} and ${names[1]}`;
return `%(${names[0]}) and %(${names[1]})`;
} else {
const plural = countWithoutMe > 1;
if (plural) {
return `${names[0]} and ${countWithoutMe} others`;
return `%(${names[0]}) and %(${countWithoutMe}) others`;
} else {
return `${names[0]} and 1 other`;
return `%(${names[0]}) and 1 other`;
}
}
}
Expand Down

0 comments on commit 9259cf0

Please sign in to comment.