T
T
Tsuzukeru2021-10-06 20:30:16
Android
Tsuzukeru, 2021-10-06 20:30:16

Why do plurals for the word car work incorrectly?

There are such plurals, which lies in the strings file

<plurals name="cars">
        <item quantity="zero">%d автомобилей</item>
        <item quantity="one">%d автомобиль</item>
        <item quantity="two">%d автомобиля</item>
        <item quantity="few">%d автомобиля</item>
        <item quantity="many">%d автомобилей</item>
        <item quantity="other">%d автомобилей</item>
    </plurals>


I get a string like this:
resources.getQuantityString(R.plurals.cars, 2, 2)

comes - 2 cars (other)

If you do not register other, the application crashes

android.content.res.Resources$NotFoundException: Plural resource ID #0x7f110001 quantity=2 item=other

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question