-
-
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
fix(isAlpha): fix ح character validation in fa-IR language code (#1400) #1455
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1455 +/- ##
=======================================
Coverage 99.92% 99.92%
=======================================
Files 96 96
Lines 1275 1276 +1
=======================================
+ Hits 1274 1275 +1
Misses 1 1
Continue to review full report at Codecov.
|
Thanks for your contribution! Please rebase your branch with |
I have removed all unnecessary changes, please tell me if i do something wrong here. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contrib 🎉 // Just update the README and we should be good to go.
Im pretty sure that there are nothing to be updated in the readme file regarding these changes as its already well-documented there (in the readme) @profnandaa Edit: I've checked all the boxes so its all clear |
src/lib/alpha.js
Outdated
@@ -25,6 +25,7 @@ export const alpha = { | |||
'uk-UA': /^[А-ЩЬЮЯЄIЇҐі]+$/i, | |||
'vi-VN': /^[A-ZÀÁẠẢÃÂẦẤẬẨẪĂẰẮẶẲẴĐÈÉẸẺẼÊỀẾỆỂỄÌÍỊỈĨÒÓỌỎÕÔỒỐỘỔỖƠỜỚỢỞỠÙÚỤỦŨƯỪỨỰỬỮỲÝỴỶỸ]+$/i, | |||
'ku-IQ': /^[ئابپتجچحخدرڕزژسشعغفڤقکگلڵمنوۆھەیێيطؤثآإأكضصةظذ]+$/i, | |||
'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can move this to L10 so that it's in alphabetic order.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing!,
ill do it tonight (got to pray first)
@fakhrip -- my bad, thought it was a new locale. |
Im sorry but i didnt get it, in which file should i see this ? |
That's |
Can we just add this to line 121 in |
Ok, that works, you can drop in a comment before that. |
Done, if there are anything i should do, please tell me 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks for your contrib once again! 🎉
Sure, thank you so much for being good as this is my first legit PR 😃 |
Welcome buddy, looking forward to seeing more from you :) |
@profnandaa @fakhrip i don't understand the purpose of the change in L124 😅 |
It was overriden by L101 @tux-tn , |
I still don't get it, since alpha array has already been mutated |
export const farsiLocales = [
'IR', 'AF',
];
for (let locale, i = 0; i < farsiLocales.length; i++) {
locale = `fa-${farsiLocales[i]}`;
alpha[locale] = alpha.fa; // This line changes alpha[fa-IR] content to alpha.fa
alphanumeric[locale] = alphanumeric.fa;
decimal[locale] = decimal.fa;
} And because that the content of 'fa-IR': /^[ابپتثجچحخدذرزژسشصضطظعغفقکگلمنوهی]+$/i,
fa: /^['0-9آاءأؤئبپتثجچحخدذرزژسشصضطظعغفقکگلمنوهةی۱۲۳۴۵۶۷۸۹۰']+$/i, It will then be needed to re-override the |
|
Oh wait, i just realized that i was wrong XD, i'm very sorry dude, now i feel like really stupid... |
Do you think i need to fix this in another PR as this one already got merged, or what should i do best ? |
@fakhrip actually i'm asking the question because i'm working on a PR to update dependencies (including eslint who keeps screaming about that line) i fixed it in my branch and i'll probably create a PR by the end of the week. |
@fakhrip no problem my friend, thank you for taking the time to answer my questions. It's not a big deal |
thanks for the due diligence on this @tux-tn |
I added some Persian alphabet characters retrieved from wikipedia on this line
Also add new validation regarding the language in the validator.js
This PR specifically fix #1400
Checklist