mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-25 19:05:56 +03:00
Use plurals for proper i18n
This commit is contained in:
parent
206e68b1d2
commit
1eac90e5b1
2 changed files with 15 additions and 8 deletions
|
@ -138,7 +138,9 @@ internal class RoomDisplayNameResolver @Inject constructor(
|
|||
}
|
||||
else -> {
|
||||
val remainingCount = invitedCount + joinedCount - otherMembersCount + 1
|
||||
stringProvider.getString(R.string.room_displayname_four_and_more_members,
|
||||
stringProvider.getQuantityString(
|
||||
R.plurals.room_displayname_four_and_more_members,
|
||||
remainingCount,
|
||||
resolveRoomMemberName(otherMembersSubset[0], roomMembers),
|
||||
resolveRoomMemberName(otherMembersSubset[1], roomMembers),
|
||||
resolveRoomMemberName(otherMembersSubset[2], roomMembers),
|
||||
|
|
|
@ -175,10 +175,15 @@
|
|||
|
||||
<!-- The 2 parameters will be members' name -->
|
||||
<string name="room_displayname_two_members">%1$s and %2$s</string>
|
||||
<!-- The 3 parameters will be members' name -->
|
||||
<string name="room_displayname_3_members">%1$s, %2$s and %3$s</string>
|
||||
<!-- The 4 parameters will be members' name -->
|
||||
<string name="room_displayname_4_members">%1$s, %2$s, %3$s and %4$s</string>
|
||||
<string name="room_displayname_four_and_more_members">%1$s, %2$s, %3$s and %4$d others</string>
|
||||
|
||||
<!-- The 3 first parameters will be members' name -->
|
||||
<plurals name="room_displayname_four_and_more_members">
|
||||
<item quantity="one">%1$s, %2$s, %3$s and %4$d other</item>
|
||||
<item quantity="other">%1$s, %2$s, %3$s and %4$d others</item>
|
||||
</plurals>
|
||||
<plurals name="room_displayname_three_and_more_members">
|
||||
<item quantity="one">%1$s and 1 other</item>
|
||||
<item quantity="other">%1$s and %2$d others</item>
|
||||
|
|
Loading…
Reference in a new issue