summary refs log tree commit diff
path: root/src/TypingDisplay.cpp
diff options
context:
space:
mode:
authorWeblate <noreply@weblate.nheko.im>2019-07-28 15:11:26 -0400
committerWeblate <noreply@weblate.nheko.im>2019-07-28 15:11:26 -0400
commite3d69957d391acfec8be84bda9a94e20ee615c40 (patch)
treea9e91e2d5dd422bfecf71bd757b651ad136d7e5b /src/TypingDisplay.cpp
parentTranslated using Weblate (Finnish) (diff)
parentAdd 'and' to typing display (diff)
downloadnheko-e3d69957d391acfec8be84bda9a94e20ee615c40.tar.xz
Merge branch '0.7.0-dev' of github.com:Nheko-Reborn/nheko into 0.7.0-dev
Fix merge conflicts with weblate translation files.
Diffstat (limited to 'src/TypingDisplay.cpp')
-rw-r--r--src/TypingDisplay.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/TypingDisplay.cpp b/src/TypingDisplay.cpp

index 6059601d..43fabcd8 100644 --- a/src/TypingDisplay.cpp +++ b/src/TypingDisplay.cpp
@@ -33,6 +33,14 @@ TypingDisplay::setUsers(const QStringList &uid) text_.clear(); + QString temp = text_ += + tr("%1 and %2 are typing", + "Multiple users are typing. First argument is a comma separated list of potentially " + "multiple users. Second argument is the last user of that list. (If only one user is " + "typing, %1 is empty. You should still use it in your string though to silence Qt " + "warnings.)", + uid.size()); + if (uid.isEmpty()) { hide(); update(); @@ -40,12 +48,9 @@ TypingDisplay::setUsers(const QStringList &uid) return; } - text_ = uid.join(", "); - - if (uid.size() == 1) - text_ += tr(" is typing"); - else if (uid.size() > 1) - text_ += tr(" are typing"); + QStringList uidWithoutLast = uid; + uidWithoutLast.pop_back(); + text_ = temp.arg(uidWithoutLast.join(", ")).arg(uid.back()); show(); update();