Skip to content
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

Mobile Phone validations - For The First Time Contributors #1761

Open
ezkemboi opened this issue Oct 8, 2021 · 98 comments · May be fixed by #2365 or #2367
Open

Mobile Phone validations - For The First Time Contributors #1761

ezkemboi opened this issue Oct 8, 2021 · 98 comments · May be fixed by #2365 or #2367

Comments

@ezkemboi
Copy link
Member

ezkemboi commented Oct 8, 2021

I would like to give this to the people who are new and would like to start contributing to validator.js.

The current version in isMobilePhone validation, we have less than 195 phone validations i.e

In the code https://github.com/validatorjs/validator.js/blob/master/src/lib/isMobilePhone.js, the validations exist from line 5 to line 119, which means we have probably 119 - 5 countries phone validations. Where might be other countries? That is up to someone who would like to choose which country does not exist and create a new validation for the same.

When making this change, apart from the file above, also add tests and update the isMobilePhone section in the README.

Also, please check on existing PR's if the country you choose to validate mobile phone numbers does not have an already PR raised.

All Prs are welcomed and we will do a review on the same

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 8, 2021

Great catch, please do add @mairagee524 and reference your PR to this issue with the correct title such as
phone number for Mexico(code) etc.

Thanks and looking forward to your PR.
I will also double-check on the same.

@pasagedev
Copy link
Contributor

It seems that Cuba is not on the list either, could I work on that ?

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 8, 2021 via email

@neel-desh
Copy link

neel-desh commented Oct 9, 2021

Afghanistan is also missing, working on that...

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 9, 2021 via email

@neel-desh
Copy link

neel-desh commented Oct 9, 2021

Please do add and raise a Pr

On Sat, Oct 9, 2021, 3:15 PM Neel Deshmukh @.***> wrote: Afghanistan is also missing, I belive — You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub <#1761 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALVWPH3HH5S7MKWFE26FRYLUGAW57ANCNFSM5FSXM3NQ . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Yes, I did.

Btw, for new contributors, what i did was find list of the country code and their ISO codes, wrote simple program to filter non existing countries and wrote the code.

here are the resources :
https://www.att.com/support_media/images/pdf/Country_Code_List.pdf
https://countrycode.org/

@ezkemboi I'm not adding all the missing country code validations, i would like other people to contribute, but after October if still there are no contributions in this or we have missing validations, I would try to complete the list...

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 9, 2021 via email

@mgndolan
Copy link
Contributor

I didn't see Botswana on the list. Could I add this validation?

@ezkemboi
Copy link
Member Author

@mgndolan please add that and raise a PR, I will review that.

@rootkit7628
Copy link

It seems like Madagascar in not on the list. Could I add this validation?

@Sidd2024
Copy link

looks like grenada is also not there in the list, should i add this a validation for this?

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 10, 2021 via email

@lakshayr003
Copy link
Contributor

It seems like Bhutan is not on the list, should I add validation for this? @ezkemboi

@ezkemboi
Copy link
Member Author

Yes @lakshayr003

@HackProAIT
Copy link
Contributor

It would we nice if we could write comment country name in front of each country code.

@tarob0ba
Copy link
Contributor

I was just poking around and noticed that there wasn't an entry for Cameroon. Should I work on this?

@tarob0ba
Copy link
Contributor

Opened PR #1772.

@ezkemboi
Copy link
Member Author

Good stuff @beckettnormington.
Thanks all for opening PRs, let's keep them coming.
I will spend this week reviewing them.

@Madhavi96
Copy link
Contributor

@ezkemboi Hi!
I previously did a contribution to this project, by adding mobile phone number validation for Sri Lanka. I was inspired to participate in Hacktoberfest this time and reached out again.

Just noticed that the contribution I added to validate mobile numbers in Sri Lanka has been replaced by this:
en-SL': /^(\+?232|0)\d{8}$/

However, it does not validate mobile numbers in Sri Lanka correctly (sources: https://en.wikipedia.org/wiki/Telephone_numbers_in_Sri_Lanka).

Is there a specific reason for the change?
If not, I can make the necessary changes to make it work correctly again. Thank you!

@ezkemboi
Copy link
Member Author

Please do make the changes @Madhavi96 .
But, also, I will need to make sure why it was changed and if the changes made are also necessary.
Thank you.

@Madhavi96
Copy link
Contributor

Thanks. Let me know if you find anything on the requirement for the change. Until then I'll do the changes and raise a PR.

@Madhavi96
Copy link
Contributor

@ezkemboi Found the validation for Sri Lanka, under 'si-LK': /^(?:0|94|\+94)?(7(0|1|2|5|6|7|8)( |-)?\d)\d{6}$/, and that is correct

Apologies for the false alarm!

@ezkemboi
Copy link
Member Author

ezkemboi commented Oct 11, 2021 via email

@Siddhant-Kashyap
Copy link

Siddhant-Kashyap commented Aug 4, 2023

Hi!
Founded that ' Guam ' phone number is not added in the list so i am adding it
#2255
Please someone review it .

@SimranSiddiqui
Copy link
Contributor

Hey! I would like to do my first contribution. I saw Malawi is not on the list. Can I work on that?

@WikiRik
Copy link
Member

WikiRik commented Aug 16, 2023

Hey! I would like to do my first contribution. I saw Malawi is not on the list. Can I work on that?

@SimranSiddiqui of course, go ahead! Do also check out what was done in the past; #1823

@SimranSiddiqui
Copy link
Contributor

Hey! I would like to do my first contribution. I saw Malawi is not on the list. Can I work on that?

@SimranSiddiqui of course, go ahead! Do also check out what was done in the past; #1823

#2267

@ShambhavII-Singh
Copy link

Hey! I did not find Croatia on the list. Can I add that? I will be making a PR shortly.

@Manu024
Copy link

Manu024 commented Sep 27, 2023

Hi Devs, I couldnt find Puerto Rico in the list. I would like to contribute by creating a PR?

Excited to start my first open source contribution if it helps.

I found myself to make the changes in readme, isMobilePhone.js, validators.test.js files. Did I missed anything?

@WikiRik
Copy link
Member

WikiRik commented Sep 27, 2023

Feel free to contribute to this. No need to ask permission, but do check if there is already an open PR with the locale.

Most useful sources are the ITU and libPhoneNumber from Google but additional (local) sources are also welcomed

Changes are indeed made in the README, isMobilePhone.js and validators.test.js

@Manu024
Copy link

Manu024 commented Sep 28, 2023

Created #2292 PR for Puerto Rico . Please review.

Thanks in Advance

@Swamynathan-R
Copy link

created #2321 PR for Monaco, Please check and review.

Thank you.

@sadraliev
Copy link
Contributor

Hello, can I create a PR to update the regular expression for Kyrgyzstan phone numbers? The ones currently in place are not up to date.

@profnandaa
Copy link
Member

profnandaa commented Jan 9, 2024 via email

@sadraliev
Copy link
Contributor

Created #2350 PR for Kyrgyz Republic . Please review.

Thanks in Advance! 🖖

@ignaciosuarezquilis
Copy link
Contributor

Hi, it seems that vatican city is not listed, can I work on that?

@jmustafa-96
Copy link

Hey! I would like to do my first contribution. I saw CONGO is not on the list. Can I work on that?

SurajSivakumar07 added a commit to SurajSivakumar07/validator.js that referenced this issue May 7, 2024
@SurajSivakumar07
Copy link

Shall I add Vatican City validation ?

@WikiRik
Copy link
Member

WikiRik commented May 7, 2024

There's no way to pin a comment in GitHub, so I'll copy my earlier comment to here;

Feel free to contribute to this. No need to ask permission, but do check if there is already an open PR with the locale.

Most useful sources are the ITU and libPhoneNumber from Google but additional (local) sources are also welcomed

Changes are indeed made in the README, isMobilePhone.js and validators.test.js

@legend-crypt
Copy link

I would like to add a PR to the list of contacts in Ghana

@Yashwanth-Chandrakumar
Copy link

/assign

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment