Skip to content

Conversation

@jacobras
Copy link

@jacobras jacobras commented Jan 9, 2024

Currently the library crashes on JS when using any language that doesn't have a set of PluralRules. See #53.

They should be added when needed, but I suggest not crashing on it. It's better to fall back to the English formatting rule. For many languages this will already be correct and the ones that need something else should get a custom configuration.

I would like to add some logging still when the fallback is triggered, but there's no logging mechanism in Libres currently so that's omitted.

For many languages this will already be correct and for the ones that needs a custom configuration, at least it won't crash anymore.
"kk" -> Kazakh
"fr" -> French
else -> custom[languageCode] ?: error("Plural rule for '$languageCode' not provided")
else -> custom[languageCode] ?: English
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to add some logging here, but there's no logging mechanism in the library currently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant