ReactNativeLocalization icon indicating copy to clipboard operation
ReactNativeLocalization copied to clipboard

Plural support

Open sfreeman28 opened this issue 6 years ago • 0 comments

I would really love to use this library but it is missing support for plurals which I need. eg in Android we have

// english
<plurals name="d_days">
    <item quantity="one">%d day</item>
    <item quantity="other">%d days</item>
</plurals>

// french
<plurals name="d_days">
    <item quantity="one">%d jour</item>
    <item quantity="other">%d jours</item>
</plurals>

I thought about making a function that would choose between two quantities like:

if (quantity = 1) {
    return strings.d_days_one
} else {
    return strings.d_days_other
}

but that logic does not always hold up and some languages have different words for other quantities eg: zero, two, few.

Is there any planned support for plurals and/or how are people going about solving this problem? Thanks!

sfreeman28 avatar Jun 13 '18 20:06 sfreeman28