-
-
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
Fixed pt-PT alpha and alphanumeric validation #1207
Conversation
@@ -13,7 +13,7 @@ export const alpha = { | |||
'nn-NO': /^[A-ZÆØÅ]+$/i, | |||
'hu-HU': /^[A-ZÁÉÍÓÖŐÚÜŰ]+$/i, | |||
'pl-PL': /^[A-ZĄĆĘŚŁŃÓŻŹ]+$/i, | |||
'pt-PT': /^[A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, | |||
'pt-PT': /^[A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/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.
I will look deeper into the research above. But for now, we can add or edit tests for the addition/changes made on this part.
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.
All right. Since there aren't any tests regarding this locale, I'll write it.
@@ -43,7 +43,7 @@ export const alphanumeric = { | |||
'nl-NL': /^[0-9A-ZÁÉËÏÓÖÜÚ]+$/i, | |||
'nn-NO': /^[0-9A-ZÆØÅ]+$/i, | |||
'pl-PL': /^[0-9A-ZĄĆĘŚŁŃÓŻŹ]+$/i, | |||
'pt-PT': /^[0-9A-ZÃÁÀÂÇÉÊÍÕÓÔÚÜ]+$/i, | |||
'pt-PT': /^[0-9A-ZÃÁÀÂÄÇÉÊËÍÏÕÓÔÖÚÜ]+$/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.
Apply the comment above on this part.
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. This being your first landing, welcome to the team! 🎉
In 2009 a new spelling reform abolished the diaeresis diacritical mark from the portuguese language. The agreement, however, decreed that proper names should keep it.
I have made changes to the alpha and alphanumeric validation to accepts every vowel with a diaresis mark. It's a very common use case of my projects have an input field that should holds a user name. That field should only have alpha characters and I would expect that "Schäfer" (my surname) would pass this validation.
The current validator.js version accepts the 'ü' as an alpha character, but not any other vowel with ¨. In order to be consistent it should allow every vowel or none.
✌️