docs(README): sync locale lists with the code for isAlpha, isAlphanumeric, isFloat and isIBAN - #2840
Open
simonkundrik wants to merge 1 commit into
Open
Conversation
The locale lists for isAlpha, isAlphanumeric, isFloat and isIBAN had drifted from what the validators actually support, so 32 working locales weren't discoverable from the docs. - isAlpha / isAlphanumeric: az-AZ, bn-BD, fa, fa-AF, vi-VN - isFloat: bn-BD, bn-IN, el-GR, fa-AF, fa-IR, gu-IN, hi-IN, id-ID, kk-KZ, kn-IN, ku-IQ, ml-IN, or-IN, pa-IN, si-LK, ta-IN, te-IN, vi-VN - isIBAN: DZ, MA Each entry was verified against the exported locale lists and checked at runtime. Docs only, no behaviour change.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2840 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 114 114
Lines 2598 2598
Branches 658 658
=========================================
Hits 2598 2598 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The locale lists in the README have drifted from the code. 32 locales that the validators genuinely support aren't listed anywhere in the docs, so there's no way to discover them short of reading the source.
Docs only, no behaviour change.
isAlphaaz-AZ,bn-BD,fa,fa-AF,vi-VNisAlphanumericaz-AZ,bn-BD,fa,fa-AF,vi-VNisFloatbn-BD,bn-IN,el-GR,fa-AF,fa-IR,gu-IN,hi-IN,id-ID,kk-KZ,kn-IN,ku-IQ,ml-IN,or-IN,pa-IN,si-LK,ta-IN,te-IN,vi-VNisIBANDZ,MAHow I found it
Diffed each README row against the exported locale list (
validator.isAlphaLocales,isAlphanumericLocales,isFloatLocales,ibanLocales) rather than eyeballing it. The same check now passes in both directions for all four.Worth noting the reverse direction is clean: the README never documents a locale that doesn't exist, so there was no case of a documented locale throwing at runtime. This is purely under-documentation.
Verified, not assumed
Every added locale was confirmed to actually work:
Existing entries were already in sorted order, so the new ones are inserted alphabetically and each row keeps its own separator style (
', 'for the alpha/float rows,','for the IBAN row). The diff is 4 lines.One deliberate omission
pl-Plexists inalpha,alphanumericanddecimalas a back-compat alias forpl-PL(src/lib/alpha.js, "see #862"). I left it undocumented since it's a legacy casing variant rather than a real locale, and documenting it would invite new code to use the odd casing. Happy to add it if you'd rather the lists mirror the keys exactly.This is related to #1266 but doesn't close it — that thread moved on to the broader ISO 639-1 vs ISO 3166-1 standardisation question, which this doesn't touch.
Full suite 290 passing, eslint clean.
Checklist