Merge pull request #4999 from vector-im/feature/bma/zero_vote

Fix an error in string resource (#4997)
This commit is contained in:
Benoit Marty 2022-01-20 10:38:33 +01:00 committed by GitHub
commit c40fc52ef5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 7 additions and 2 deletions

1
changelog.d/4997.bugfix Normal file
View File

@ -0,0 +1 @@
Fix an error in string resource

View File

@ -190,7 +190,11 @@ class MessageItemFactory @Inject constructor(
when {
isEnded -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_after_ended, it, it)
didUserVoted -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_voted, it, it)
else -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_not_voted, it, it)
else -> if (it == 0) {
stringProvider.getString(R.string.poll_no_votes_cast)
} else {
stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_not_voted, it, it)
}
}
}

View File

@ -3693,8 +3693,8 @@
<item quantity="one">Based on %1$d vote</item>
<item quantity="other">Based on %1$d votes</item>
</plurals>
<string name="poll_no_votes_cast">No votes cast</string>
<plurals name="poll_total_vote_count_before_ended_and_not_voted">
<item quantity="zero">No votes cast</item>
<item quantity="one">%1$d vote cast. Vote to the see the results</item>
<item quantity="other">%1$d votes cast. Vote to the see the results</item>
</plurals>