Convert a11y_polls_percent_of_total to plurals
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
|
||||
<string name="a11y_polls_percent_of_total">"%1$d percent of total votes"</string>
|
||||
<plurals name="a11y_polls_percent_of_total">
|
||||
<item quantity="one">"%1$d percent of total votes"</item>
|
||||
<item quantity="other">"%1$d percents of total votes"</item>
|
||||
</plurals>
|
||||
<string name="a11y_polls_winning_answer">"This is the winning answer"</string>
|
||||
</resources>
|
||||
|
||||
Reference in New Issue
Block a user