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

Fixed pl-PL locale name bug #862

Merged
merged 2 commits into from
Jul 31, 2018
Merged

Fixed pl-PL locale name bug #862

merged 2 commits into from
Jul 31, 2018

Conversation

retrowaver
Copy link
Contributor

Polish locale pl-PL was written as pl-Pl (lowercase L) in a few spots in code, causing errors when using it. Therefore I replaced all pl-Pl to pl-PL.

Copy link
Member

@profnandaa profnandaa left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's a good catch! 👍

  1. Did we have tests for this? Can that be changed too?
  2. How can we support backward compatibility if we have folks already using pl-Pl in production right now?

@retrowaver
Copy link
Contributor Author

  1. I'd propose a test comparing names of locales in alpha, alphanumeric, commaDecimal and phones, looking for names that are the same in case insensitive comparison, but different in case sensitive one. The thing is I have zero experience with js tests / more advanced js in general, so I'm not sure if it's the right approach / it is even possible / how to actually do it.
  2. I think decimal['pl-Pl'] = decimal['pl-PL']; should do the trick (in validator.js around line 580 ).

@chriso
Copy link
Collaborator

chriso commented Jul 31, 2018

Thanks for the PR 😄 I'll create an alias for backwards compatibility.

@chriso chriso merged commit 06d94fd into validatorjs:master Jul 31, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants