Add utils.commaAndJoin() for "a, b and c" strings
This commit is contained in:
@@ -13,11 +13,8 @@ InfoBar {
|
||||
label.textFormat: Text.StyledText
|
||||
label.text: {
|
||||
const tm = typingMembers
|
||||
|
||||
if (tm.length === 0) return ""
|
||||
if (tm.length === 1) return qsTr("%1 is typing...").arg(tm[0])
|
||||
|
||||
return qsTr("%1 and %2 are typing...")
|
||||
.arg(tm.slice(0, -1).join(", ")).arg(tm.slice(-1)[0])
|
||||
return qsTr("%1 are typing...").arg(utils.commaAndJoin(tm))
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user