-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Open
Labels
Description
Describe the bug
isLocale does not validate language tags correctly. There are a lot of valid language tags that are not valid for isLocale. But could be that I do not understand correctly if there is a difference between "locale" and "language tag".
Examples
i.e. zh-CHS is not correctly validated by isLocale. In fact every locale with a 3 letter subtag is invalidated. According to the Wikipedia page (I know, but primary sources are hard to come by) there are a lot of other valid codes not covered by the regex of isLocale.
Additional context
Validator.js version: Master & all since isLocale is introduced
Node.js version: not relevant
OS platform: not relevant