diff --git a/resources/langs/nheko_de.ts b/resources/langs/nheko_de.ts index 1f856b8083fde5a6ff175bc4f4609c04e7b9cdfd..80a50ae2f19c3fd005386986b9965e43d64c714d 100644 --- a/resources/langs/nheko_de.ts +++ b/resources/langs/nheko_de.ts @@ -494,15 +494,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> tippt</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> tippen</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation> + <numerusform>%1%2 tippt</numerusform> + <numerusform>%1 und %2 tippen</numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_el.ts b/resources/langs/nheko_el.ts index e50aadad771c8fd38fd471ff0f0f07c9b8e89923..ead1ed690bcb967331d216d1f43001b184380e25 100644 --- a/resources/langs/nheko_el.ts +++ b/resources/langs/nheko_el.ts @@ -494,15 +494,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> πληκτÏολογεί</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> πληκτÏολογοÏν</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_en.ts b/resources/langs/nheko_en.ts index e031c4ec05107131d43c4937209c7017df86f6fc..0ab8d6d8514c1ecb0c395a176dceea4cea2ba092 100644 --- a/resources/langs/nheko_en.ts +++ b/resources/langs/nheko_en.ts @@ -494,15 +494,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation type="unfinished"></translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation> + <numerusform>%1%2 is typing</numerusform> + <numerusform>%1 and %2 are typing</numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_fi.ts b/resources/langs/nheko_fi.ts index 2baba55db49bbf16a1fe3d28ac7dd71ef6e02e06..95403f3ebac6b6b676f276a0bc6614d384b45e1f 100644 --- a/resources/langs/nheko_fi.ts +++ b/resources/langs/nheko_fi.ts @@ -494,15 +494,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation type="unfinished"></translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation type="unfinished"></translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_fr.ts b/resources/langs/nheko_fr.ts index 355c432599d278fb766f281d0b83451a4235e4f7..9c7f25c6a8f61b636ac731c319301fcc234bca9d 100644 --- a/resources/langs/nheko_fr.ts +++ b/resources/langs/nheko_fr.ts @@ -495,15 +495,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> est en train d'écrire</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> sont en train d'écrire</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_nl.ts b/resources/langs/nheko_nl.ts index db56dc0fb9734601b4b303b7341826434f5e7a8c..dbf81401a4c5e7c426344004a20386e231e843fe 100644 --- a/resources/langs/nheko_nl.ts +++ b/resources/langs/nheko_nl.ts @@ -494,15 +494,14 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> is aan het typen</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> zijn aan het typen</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_pl.ts b/resources/langs/nheko_pl.ts index 34a4ed264291f23112dfc52aed90f258020f47c2..f4cbfd56e8bde233643510968d9c1e25d25d469c 100644 --- a/resources/langs/nheko_pl.ts +++ b/resources/langs/nheko_pl.ts @@ -494,15 +494,15 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> pisze</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> piszÄ…</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_ru.ts b/resources/langs/nheko_ru.ts index afe36ef94a0024c99ef0df32a0aadcb055934a66..f31b23cf0680ba20002ccdf0c20e4f1d22efdc75 100644 --- a/resources/langs/nheko_ru.ts +++ b/resources/langs/nheko_ru.ts @@ -494,15 +494,15 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> печатает</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> печатают</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + <numerusform></numerusform> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/resources/langs/nheko_zh_CN.ts b/resources/langs/nheko_zh_CN.ts index 607b2ba95cd73ba69603e0f2cd948b228ca8c826..8da7c475f9c80e0b78949fe60fbf6e8b0ae5ee20 100644 --- a/resources/langs/nheko_zh_CN.ts +++ b/resources/langs/nheko_zh_CN.ts @@ -494,15 +494,13 @@ </context> <context> <name>TypingDisplay</name> - <message> - <location filename="../../src/TypingDisplay.cpp" line="+46"/> - <source> is typing</source> - <translation> æ£åœ¨æ‰“å—</translation> - </message> - <message> - <location line="+2"/> - <source> are typing</source> - <translation> æ£åœ¨æ‰“å—</translation> + <message numerus="yes"> + <location filename="../../src/TypingDisplay.cpp" line="+37"/> + <source>%1 and %2 are typing</source> + <comment>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.)</comment> + <translation type="unfinished"> + <numerusform></numerusform> + </translation> </message> </context> <context> diff --git a/src/TypingDisplay.cpp b/src/TypingDisplay.cpp index 6059601d0aa315010d68f3ce582c12bb1be707f2..43fabcd891e05fcfcb52df5b4d768b076f8b026e 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(); diff --git a/src/timeline/TimelineItem.h b/src/timeline/TimelineItem.h index a3294d3f0afae07c6499634e4982f86897e71232..fe354000e23669a4f2d7a50efcfaab132b49ff15 100644 --- a/src/timeline/TimelineItem.h +++ b/src/timeline/TimelineItem.h @@ -277,7 +277,7 @@ private: QFutureWatcher<QString> *colorGenerating_; QString event_id_; - mtx::events::MessageType message_type_ = mtx::events::MessageType::Unknown; + mtx::events::MessageType message_type_ = mtx::events::MessageType::Unknown; QString room_id_; DescInfo descriptionMsg_;