Skip to content
Snippets Groups Projects
Verified Commit 0a10830f authored by Janne Mareike Koschinski's avatar Janne Mareike Koschinski
Browse files

Improve display of netsplits

parent c4c03a05
No related branches found
No related tags found
No related merge requests found
Pipeline #280 passed
...@@ -575,12 +575,21 @@ class QuasselMessageRenderer @Inject constructor( ...@@ -575,12 +575,21 @@ class QuasselMessageRenderer @Inject constructor(
val split = message.content.content.split("#:#") val split = message.content.content.split("#:#")
val (server1, server2) = split.last().split(' ') val (server1, server2) = split.last().split(' ')
val usersAffected = split.size - 1 val usersAffected = split.size - 1
val users = split.subList(0, split.size - 1).map {
contentFormatter.formatNick(it, false, monochromeForeground, false)
}
FormattedMessage( FormattedMessage(
id = message.content.messageId, id = message.content.messageId,
time = timeFormatter.format(message.content.time.atZone(zoneId)), time = timeFormatter.format(message.content.time.atZone(zoneId)),
dayChange = formatDayChange(message), dayChange = formatDayChange(message),
combined = context.resources.getQuantityString( combined = context.resources.getQuantityString(
R.plurals.message_netsplit_join, usersAffected, server1, server2, usersAffected R.plurals.message_netsplit_join,
usersAffected,
server1,
server2,
usersAffected,
users.joinToString(", ")
), ),
hasDayChange = message.hasDayChange, hasDayChange = message.hasDayChange,
isMarkerLine = message.isMarkerLine, isMarkerLine = message.isMarkerLine,
...@@ -592,12 +601,21 @@ class QuasselMessageRenderer @Inject constructor( ...@@ -592,12 +601,21 @@ class QuasselMessageRenderer @Inject constructor(
val split = message.content.content.split("#:#") val split = message.content.content.split("#:#")
val (server1, server2) = split.last().split(' ') val (server1, server2) = split.last().split(' ')
val usersAffected = split.size - 1 val usersAffected = split.size - 1
val users = split.subList(0, split.size - 1).map {
contentFormatter.formatNick(it, false, monochromeForeground, false)
}
FormattedMessage( FormattedMessage(
id = message.content.messageId, id = message.content.messageId,
time = timeFormatter.format(message.content.time.atZone(zoneId)), time = timeFormatter.format(message.content.time.atZone(zoneId)),
dayChange = formatDayChange(message), dayChange = formatDayChange(message),
combined = context.resources.getQuantityString( combined = context.resources.getQuantityString(
R.plurals.message_netsplit_quit, usersAffected, server1, server2, usersAffected R.plurals.message_netsplit_quit,
usersAffected,
server1,
server2,
usersAffected,
users.joinToString(", ")
), ),
hasDayChange = message.hasDayChange, hasDayChange = message.hasDayChange,
isMarkerLine = message.isMarkerLine, isMarkerLine = message.isMarkerLine,
......
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
<string name="message_format_kill_1">%1$s wurde von %2$s%3$s aus dem Netzwerk geworfen</string> <string name="message_format_kill_1">%1$s wurde von %2$s%3$s aus dem Netzwerk geworfen</string>
<string name="message_format_kill_2">%1$s wurde von %2$s%3$s aus dem Chat geworfen (%4$s)</string> <string name="message_format_kill_2">%1$s wurde von %2$s%3$s aus dem Chat geworfen (%4$s)</string>
<plurals name="message_netsplit_join"> <plurals name="message_netsplit_join">
<item quantity="one">Netsplit zwischen %1$s und %2$s beendet: %3$d Nutzer war betroffen</item> <item quantity="one">Netsplit zwischen %1$s und %2$s beendet: %3$d Nutzer war betroffen: %4$s</item>
<item quantity="other">Netsplit zwischen %1$s und %2$s beendet: %3$d Nutzer waren betroffen</item> <item quantity="other">Netsplit zwischen %1$s und %2$s beendet: %3$d Nutzer waren betroffen: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit"> <plurals name="message_netsplit_quit">
<item quantity="one">Netsplit zwischen %1$s und %2$s: %3$d Nutzer ist betroffen</item> <item quantity="one">Netsplit zwischen %1$s und %2$s: %3$d Nutzer ist betroffen: %4$s</item>
<item quantity="other">Netsplit zwischen %1$s und %2$s: %3$d Nutzer sind betroffen</item> <item quantity="other">Netsplit zwischen %1$s und %2$s: %3$d Nutzer sind betroffen: %4$s</item>
</plurals> </plurals>
</resources> </resources>
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
<string name="message_format_kill_1">%1$s a été supprimé %2$s%3$s</string> <string name="message_format_kill_1">%1$s a été supprimé %2$s%3$s</string>
<string name="message_format_kill_2">%1$s a été supprimé par %2$s%3$s (%4$s)</string> <string name="message_format_kill_2">%1$s a été supprimé par %2$s%3$s (%4$s)</string>
<plurals name="message_netsplit_join"> <plurals name="message_netsplit_join">
<item quantity="one">Netsplit entre %1$s et %2$s est terminé: %3$d nouvel utilisateur</item> <item quantity="one">Netsplit entre %1$s et %2$s est terminé: %3$d nouvel utilisateur: %4$s</item>
<item quantity="other">Netsplit entre %1$s et %2$s est terminé: %3$d nouveaux utilisateurs</item> <item quantity="other">Netsplit entre %1$s et %2$s est terminé: %3$d nouveaux utilisateurs: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit"> <plurals name="message_netsplit_quit">
<item quantity="one">Netsplit entre %1$s et %2$s: %3$d utilisateur a quitté</item> <item quantity="one">Netsplit entre %1$s et %2$s: %3$d utilisateur a quitté: %4$s</item>
<item quantity="other">Netsplit entre %1$s et %2$s: %3$d utilisateurs ont quittés</item> <item quantity="other">Netsplit entre %1$s et %2$s: %3$d utilisateurs ont quittés: %4$s</item>
</plurals> </plurals>
</resources> </resources>
...@@ -43,15 +43,15 @@ ...@@ -43,15 +43,15 @@
<string name="message_format_kill_2">%1$s buvo nužudytas %2$s%3$s (%4$s)</string> <string name="message_format_kill_2">%1$s buvo nužudytas %2$s%3$s (%4$s)</string>
<!-- Transifex’ quantity handling is different from Android’s. Issue opened on 2018-05-18 --> <!-- Transifex’ quantity handling is different from Android’s. Issue opened on 2018-05-18 -->
<plurals name="message_netsplit_join" tools:ignore="UnusedQuantity"> <plurals name="message_netsplit_join" tools:ignore="UnusedQuantity">
<item quantity="one">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojas prisijungė</item> <item quantity="one">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojas prisijungė: %4$s</item>
<item quantity="few">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojai prisijungė</item> <item quantity="few">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojai prisijungė: %4$s</item>
<item quantity="many">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojų prisijungė</item> <item quantity="many">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojų prisijungė: %4$s</item>
<item quantity="other">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojų prisijungė</item> <item quantity="other">Netsplit tarp %1$s ir %2$s baigėsi: %3$d vartotojų prisijungė: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit" tools:ignore="UnusedQuantity"> <plurals name="message_netsplit_quit" tools:ignore="UnusedQuantity">
<item quantity="one">Netsplit tarp %1$s ir %2$s: %3$d vartotojas išėjo</item> <item quantity="one">Netsplit tarp %1$s ir %2$s: %3$d vartotojas išėjo: %4$s</item>
<item quantity="few">Netsplit tarp %1$s ir %2$s: %3$d vartotojai išėjo</item> <item quantity="few">Netsplit tarp %1$s ir %2$s: %3$d vartotojai išėjo: %4$s</item>
<item quantity="many">Netsplit tarp %1$s ir %2$s: %3$d vartotojų išėjo</item> <item quantity="many">Netsplit tarp %1$s ir %2$s: %3$d vartotojų išėjo: %4$s</item>
<item quantity="other">Netsplit tarp %1$s ir %2$s: %3$d vartotojų išėjo</item> <item quantity="other">Netsplit tarp %1$s ir %2$s: %3$d vartotojų išėjo: %4$s</item>
</plurals> </plurals>
</resources> </resources>
...@@ -42,11 +42,11 @@ ...@@ -42,11 +42,11 @@
<string name="message_format_kill_1">%1$s foi killado por %2$s%3$s</string> <string name="message_format_kill_1">%1$s foi killado por %2$s%3$s</string>
<string name="message_format_kill_2">%1$s foi killado por %2$s%3$s (%4$s)</string> <string name="message_format_kill_2">%1$s foi killado por %2$s%3$s (%4$s)</string>
<plurals name="message_netsplit_join"> <plurals name="message_netsplit_join">
<item quantity="one">Netsplit entre %1$s e %2$s terminou: %3$d utilizadores entraram</item> <item quantity="one">Netsplit entre %1$s e %2$s terminou: %3$d utilizadores entraram: %4$s</item>
<item quantity="other">Netsplit entre %1$s e %2$s terminou: %3$d utilizadores entraram</item> <item quantity="other">Netsplit entre %1$s e %2$s terminou: %3$d utilizadores entraram: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit"> <plurals name="message_netsplit_quit">
<item quantity="one">Netsplit entre %1$s and %2$s: %3$d user qui</item> <item quantity="one">Netsplit entre %1$s and %2$s: %3$d user qui: %4$s</item>
<item quantity="other">Netsplit entre %1$s e %2$s: %3$d utilizadores desligaram</item> <item quantity="other">Netsplit entre %1$s e %2$s: %3$d utilizadores desligaram: %4$s</item>
</plurals> </plurals>
</resources> </resources>
...@@ -42,13 +42,13 @@ ...@@ -42,13 +42,13 @@
<string name="message_format_kill_1">%1$s je ubijen/na od %2$s%3$s</string> <string name="message_format_kill_1">%1$s je ubijen/na od %2$s%3$s</string>
<string name="message_format_kill_2">%1$s je ubijen/na od %2$s%3$s (%4$s)</string> <string name="message_format_kill_2">%1$s je ubijen/na od %2$s%3$s (%4$s)</string>
<plurals name="message_netsplit_join"> <plurals name="message_netsplit_join">
<item quantity="one">Netsplit između %1$s i %2$s se završio: %3$d se pridružio/la</item> <item quantity="one">Netsplit između %1$s i %2$s se završio: %3$d se pridružio/la: %4$s</item>
<item quantity="few">Netsplit između %1$s i %2$s se završio: %3$d su se pridružili</item> <item quantity="few">Netsplit između %1$s i %2$s se završio: %3$d su se pridružili: %4$s</item>
<item quantity="other">Netsplit između %1$s i %2$s se završio: %3$d korisnika se pridružilo</item> <item quantity="other">Netsplit između %1$s i %2$s se završio: %3$d korisnika se pridružilo: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit"> <plurals name="message_netsplit_quit">
<item quantity="one">Netsplit između %1$s i %2$s: %3$d je napustio/la</item> <item quantity="one">Netsplit između %1$s i %2$s: %3$d je napustio/la: %4$s</item>
<item quantity="few">Netsplit između %1$s i %2$s: %3$d su napustili</item> <item quantity="few">Netsplit između %1$s i %2$s: %3$d su napustili: %4$s</item>
<item quantity="other">Netsplit između %1$s i %2$s: %3$d korisnika je prekinulo vezu</item> <item quantity="other">Netsplit između %1$s i %2$s: %3$d korisnika je prekinulo vezu: %4$s</item>
</plurals> </plurals>
</resources> </resources>
...@@ -51,11 +51,11 @@ ...@@ -51,11 +51,11 @@
<string name="message_format_kill_1">%1$s was killed by %2$s%3$s</string> <string name="message_format_kill_1">%1$s was killed by %2$s%3$s</string>
<string name="message_format_kill_2">%1$s was killed by %2$s%3$s (%4$s)</string> <string name="message_format_kill_2">%1$s was killed by %2$s%3$s (%4$s)</string>
<plurals name="message_netsplit_join"> <plurals name="message_netsplit_join">
<item quantity="one">Netsplit between %1$s and %2$s ended: %3$d user joined</item> <item quantity="one">Netsplit between %1$s and %2$s ended: %3$d user joined: %4$s</item>
<item quantity="other">Netsplit between %1$s and %2$s ended: %3$d users joined</item> <item quantity="other">Netsplit between %1$s and %2$s ended: %3$d users joined: %4$s</item>
</plurals> </plurals>
<plurals name="message_netsplit_quit"> <plurals name="message_netsplit_quit">
<item quantity="one">Netsplit between %1$s and %2$s: %3$d user quit</item> <item quantity="one">Netsplit between %1$s and %2$s: %3$d user quit: %4$s</item>
<item quantity="other">Netsplit between %1$s and %2$s: %3$d users quit</item> <item quantity="other">Netsplit between %1$s and %2$s: %3$d users quit: %4$s</item>
</plurals> </plurals>
</resources> </resources>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment