mirror of
https://github.com/vitorpamplona/amethyst.git
synced 2026-10-05 19:28:25 +00:00
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:
co-authored by
Claude Opus 5
parent
bc3ce1139b
commit
88f81bbff9
+3
-1
@@ -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)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user