-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Invalid locale "se_SE" #818
Comments
The Sami locale |
I'm getting a similar error with multiple locales and Date formatting as well. If we zoom out a bit, is there a helper method that lets us test whether a locale is invalid so that we don't have to wrap every format call to the intl package in a try/catch? |
There are two underlying issues here, the lack of a good fallback mechanism, and the lack of a method similar to https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat/supportedLocalesOf. Both should be fixed with the upcoming |
I read through the source code of the package and found a static helper method on the For example, in
For anyone finding this, if your app is widely deployed you will see odd locales getting passed in. For example, I have several devices trying to use I wrote an extension that always checks the helper method and falls back to
My other feedback would be that it would be nice to have a global helper method because I'm assuming the INTL package supports a locale and that it's going to return the same result for either type of formatter? The way it's written now, I wanted to be safe and assume that a locale could be supported on Dates but not on Numbers. |
Please file a new issue for these feature requests! |
I got this error in Crashlytics. The error occurred after attempt to format a price.
Stack Trace:
Package version: 0.18.1
The text was updated successfully, but these errors were encountered: