Skip to content

Commit c40fc52

Browse files
authored
Merge pull request #4999 from vector-im/feature/bma/zero_vote
Fix an error in string resource (#4997)
2 parents 01ff85d + 953f34f commit c40fc52

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

changelog.d/4997.bugfix

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix an error in string resource

vector/src/main/java/im/vector/app/features/home/room/detail/timeline/factory/MessageItemFactory.kt

+5-1
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ class MessageItemFactory @Inject constructor(
190190
when {
191191
isEnded -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_after_ended, it, it)
192192
didUserVoted -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_voted, it, it)
193-
else -> stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_not_voted, it, it)
193+
else -> if (it == 0) {
194+
stringProvider.getString(R.string.poll_no_votes_cast)
195+
} else {
196+
stringProvider.getQuantityString(R.plurals.poll_total_vote_count_before_ended_and_not_voted, it, it)
197+
}
194198
}
195199
}
196200

vector/src/main/res/values/strings.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3693,8 +3693,8 @@
36933693
<item quantity="one">Based on %1$d vote</item>
36943694
<item quantity="other">Based on %1$d votes</item>
36953695
</plurals>
3696+
<string name="poll_no_votes_cast">No votes cast</string>
36963697
<plurals name="poll_total_vote_count_before_ended_and_not_voted">
3697-
<item quantity="zero">No votes cast</item>
36983698
<item quantity="one">%1$d vote cast. Vote to the see the results</item>
36993699
<item quantity="other">%1$d votes cast. Vote to the see the results</item>
37003700
</plurals>

0 commit comments

Comments
 (0)