From cfe33df5aa6fefa10b2c24645d1eafa4c431b211 Mon Sep 17 00:00:00 2001 From: Benoit Marty Date: Fri, 13 Jun 2025 13:04:24 +0200 Subject: [PATCH] Convert a11y_polls_percent_of_total to plurals --- .../android/features/poll/api/pollcontent/PollAnswerView.kt | 4 +++- features/poll/api/src/main/res/values/localazy.xml | 5 ++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/features/poll/api/src/main/kotlin/io/element/android/features/poll/api/pollcontent/PollAnswerView.kt b/features/poll/api/src/main/kotlin/io/element/android/features/poll/api/pollcontent/PollAnswerView.kt index 0c0cebca72..59d13fed1e 100644 --- a/features/poll/api/src/main/kotlin/io/element/android/features/poll/api/pollcontent/PollAnswerView.kt +++ b/features/poll/api/src/main/kotlin/io/element/android/features/poll/api/pollcontent/PollAnswerView.kt @@ -56,7 +56,9 @@ internal fun PollAnswerView( append(nbVotesText) if (answerItem.votesCount != 0) { append(sentenceDelimiter) - append(stringResource(R.string.a11y_polls_percent_of_total, (answerItem.percentage * 100).toInt())) + (answerItem.percentage * 100).toInt().let { percent -> + append(pluralStringResource(R.plurals.a11y_polls_percent_of_total, percent, percent)) + } } if (answerItem.isWinner) { append(sentenceDelimiter) diff --git a/features/poll/api/src/main/res/values/localazy.xml b/features/poll/api/src/main/res/values/localazy.xml index 2c90549056..2d1142194c 100644 --- a/features/poll/api/src/main/res/values/localazy.xml +++ b/features/poll/api/src/main/res/values/localazy.xml @@ -1,5 +1,8 @@ - "%1$d percent of total votes" + + "%1$d percent of total votes" + "%1$d percents of total votes" + "This is the winning answer"