Re-key all |zero-pluralised translations for Localazy compatibility (#11417)

* Re-key all |zero-pluralised translations for Localazy compatibility

* Add missing interpolation variable

* i18n

* Add test coverage

* Improve coverage
This commit is contained in:
Michael Telatynski 2023-08-16 16:26:21 +01:00 committed by GitHub
parent a5107518b5
commit 6b14ecfdf9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
51 changed files with 270 additions and 158 deletions

View file

@ -43,11 +43,17 @@ export function roomContextDetails(room: Room): RoomContextDetails | null {
ariaLabel: _t("In spaces %(space1Name)s and %(space2Name)s.", { space1Name, space2Name }),
};
} else if (parent) {
const spaceName = room.client.getRoom(parent)?.name;
const spaceName = room.client.getRoom(parent)?.name ?? "";
const count = otherParents.length;
if (count > 0) {
return {
details: _t("%(spaceName)s and %(count)s others", { spaceName, count }),
ariaLabel: _t("In %(spaceName)s and %(count)s other spaces.", { spaceName, count }),
};
}
return {
details: _t("%(spaceName)s and %(count)s others", { spaceName, count }),
ariaLabel: _t("In %(spaceName)s and %(count)s other spaces.", { spaceName, count }),
details: spaceName,
ariaLabel: _t("In %(spaceName)s.", { spaceName }),
};
}