fix(relay-auth): "and 1 others" in the counterparty label

Same class as the "1 other thing(s)" fix, caught on the next prompt: a relay
serving two people rendered "someone you haven't loaded yet and 1 others".
`relay_auth_name_and_n_others` was a `<string>` with a bare `%2$s` count, so it
had no singular form at all. Now a `<plurals>` keyed on the count, and the count
is passed as `%2$d` rather than a pre-stringified number.

Verified on device across both arms: "Hawk and 1 other" / "Hawk and 7 others".
Only present in values/, so no other locale needed converting.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vitor Pamplona
2026-08-12 13:20:39 -04:00
co-authored by Claude Opus 5
parent bc3ce1139b
commit 88f81bbff9
2 changed files with 7 additions and 2 deletions
@@ -411,7 +411,9 @@ private fun counterpartyLabel(
): String {
val first = pubkeys.firstOrNull() ?: return ""
val name = rememberCounterpartyName(first, accountViewModel)
return if (pubkeys.size > 1) stringRes(R.string.relay_auth_name_and_n_others, name, (pubkeys.size - 1).toString()) else name
if (pubkeys.size == 1) return name
val others = pubkeys.size - 1
return pluralStringResource(R.plurals.relay_auth_name_and_n_others, others, name, others)
}
/**
+4 -1
View File
@@ -1164,7 +1164,10 @@
<string name="relay_auth_why_my_own_relay">This is one of your own relays, and it asks everyone to log in.</string>
<string name="relay_auth_why_other">It asks everyone to log in. Amethyst can\'t tell what it\'s holding back.</string>
<string name="relay_auth_someone_unloaded">someone you haven\'t loaded yet</string>
<string name="relay_auth_name_and_n_others">%1$s and %2$s others</string>
<plurals name="relay_auth_name_and_n_others">
<item quantity="one">%1$s and %2$d other</item>
<item quantity="other">%1$s and %2$d others</item>
</plurals>
<plurals name="relay_auth_also_holding_back">
<item quantity="one">It\'s also holding back %1$d other thing.</item>
<item quantity="other">It\'s also holding back %1$d other things.</item>