From 88f81bbff9d14e24592e5ab13d9d54f615b72e6d Mon Sep 17 00:00:00 2001 From: Vitor Pamplona Date: Wed, 12 Aug 2026 13:20:39 -0400 Subject: [PATCH] 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 `` with a bare `%2$s` count, so it had no singular form at all. Now a `` 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) --- .../relayClient/authCommand/compose/RelayAuthPromptHost.kt | 4 +++- amethyst/src/main/res/values/strings.xml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt index 40df5a15aa..8f45f7eb43 100644 --- a/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt +++ b/amethyst/src/main/java/com/vitorpamplona/amethyst/service/relayClient/authCommand/compose/RelayAuthPromptHost.kt @@ -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) } /** diff --git a/amethyst/src/main/res/values/strings.xml b/amethyst/src/main/res/values/strings.xml index a703b1bc3e..909decbeb2 100644 --- a/amethyst/src/main/res/values/strings.xml +++ b/amethyst/src/main/res/values/strings.xml @@ -1164,7 +1164,10 @@ This is one of your own relays, and it asks everyone to log in. It asks everyone to log in. Amethyst can\'t tell what it\'s holding back. someone you haven\'t loaded yet - %1$s and %2$s others + + %1$s and %2$d other + %1$s and %2$d others + It\'s also holding back %1$d other thing. It\'s also holding back %1$d other things.