Merge pull request #2277 from nextcloud/feature/2265/i18n-singular-and-plural

Use singular and plural for vote(s) string
This commit is contained in:
Tim Krüger 2022-08-05 11:42:25 +02:00 committed by GitHub
commit a906e2c244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 3 deletions

View File

@ -136,8 +136,9 @@ class PollMainDialogFragment : DialogFragment() {
private fun initVotersAmount(showVotersAmount: Boolean, numVoters: Int, showResultSubtitle: Boolean) { private fun initVotersAmount(showVotersAmount: Boolean, numVoters: Int, showResultSubtitle: Boolean) {
if (showVotersAmount) { if (showVotersAmount) {
binding.pollVotesAmount.visibility = View.VISIBLE binding.pollVotesAmount.visibility = View.VISIBLE
binding.pollVotesAmount.text = String.format( binding.pollVotesAmount.text = resources.getQuantityString(
resources.getString(R.string.polls_amount_voters), R.plurals.polls_amount_voters,
numVoters,
numVoters numVoters
) )
} else { } else {

View File

@ -533,7 +533,10 @@
<!-- Polls --> <!-- Polls -->
<string name="message_poll_tap_to_open">Tap to open poll</string> <string name="message_poll_tap_to_open">Tap to open poll</string>
<string name="polls_amount_voters">%1$s votes</string> <plurals name="polls_amount_voters">
<item quantity="one">%d vote</item>
<item quantity="other">%d votes</item>
</plurals>
<string name="polls_add_option">Add option</string> <string name="polls_add_option">Add option</string>
<string name="polls_edit_vote">Edit vote</string> <string name="polls_edit_vote">Edit vote</string>
<string name="polls_submit_vote">Vote</string> <string name="polls_submit_vote">Vote</string>