-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
isLocale doesn't work anymore (returns true on wrong locals) #2342
Comments
This is due to #2189 |
I'm not an expert on regexp.
I admire the fact you want to manage these locales with regexp, but I've got the feeling rules are too complex to handle it like that. Result is that isLocale returns true for many strings that are not locale at all... Storing all locales (at least some part to build them) in an array could seem ugly and absurd at first, but well, it handles every specific rules and edge cases... that you don't manage with regexp. |
Obviously it needs to be changed. |
Language tags are described in RFC4647 and locale tags are described in RFC5646. I don't think they can coexist in same |
Describe the bug
I was using isLocale to check locale string like "en-US" or "fr-CA" and so on.
Everything was working fine on 13.9.0, but today I'm trying to upgrade to validator 13.11.0 and my unit tests are failing.
Examples
validator.isLocale("french"), validator.isLocale("frenchy") returns true in validator 13.11.0, returns false on validator 13.9.0
The text was updated successfully, but these errors were encountered: