libres icon indicating copy to clipboard operation
libres copied to clipboard

Crash on Native when using a language without plural config

Open jacobras opened this issue 2 years ago • 0 comments

Libres crashes on JS when using any language that doesn't have a set of PluralRules. For example, Dutch ("nl"), even though it follows the same rules as English.

Plural rule for 'nl' not provided IllegalStateException: Plural rule for 'nl' not provided

My current workaround:

// See also: jsMain
actual fun extendLibresPlurals() {
    // Make all Libres plurals default to the English implementation
    // Workaround until https://github.com/Skeptick/libres/issues/53 is fixed
    PluralRules["nl"] = PluralRules["en"]
    PluralRules["de"] = PluralRules["en"]
    // ... and so forth ...
}

My suggested fix: https://github.com/Skeptick/libres/pull/54

jacobras avatar Jan 09 '24 17:01 jacobras