-
Notifications
You must be signed in to change notification settings - Fork 18
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
extractUnitPatterns returns data for missing locales #23
Comments
You're getting the data from the
|
I think the best course of action would be to throw exception or just return |
I landed a fix for this, but it turned out to be problematic when extracting from the |
+1 on this. At least it would be good to have a “strict mode”, where the library does not silently fall back to root. Even if this is only partially implemented (not working on supplemental data extraction), it would be an improvement, imho. A typical use case is when working on a fallback chain of languages, e.g. |
Hmm, it would be fairly easy to just throw when attempting to extract data for a locale that does not exist in CLDR at all, but I'm not sure how to implement a strict mode like that. Since For example, That being said I don't have a full overview of everything in the CLDR -- it could be that there's some information in there that would help detect when the fallback isn't intentional. Please prove me wrong :) |
Implemented the easy one here: #73 |
I see, reality is more complex than I imagined. As always. |
I dug around a bit, but CLDR docs are pretty sparse. The closest thing I could find was that some of the incomplete locales, such as node-cldr/3rdparty/cldr/common/main/nn.xml Line 7976 in eeff9f2
That doesn't really solve the I'm out of ideas, so I'll close this for now. The "easy" fix was released in 5.0.0. |
Hello!
Thank you for your module, it works great.
However, it looks like
extractUnitPatterns
function is always returns some data, even if missing locale is specified, e.g.:extractUnitPatterns('djfhjsdhfkjhsdfkjl)
. Why this is happening and how do I detect if real data is present for the specified locale?Thank you!
The text was updated successfully, but these errors were encountered: