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

Added aliases and custom locales error #492

Merged
merged 1 commit into from
Feb 9, 2016

Conversation

oss92
Copy link
Contributor

@oss92 oss92 commented Feb 9, 2016

  • Added custom error if locale is not found.
  • Added English aliases
  • Added alpha and alphanumeric support for Spanish, French, Portugese and Dutch.
  • Sorted locales.

@oss92 oss92 force-pushed the locales_and_locales_error branch 4 times, most recently from 681067a to 9a3aa2e Compare February 9, 2016 11:29
alphanumeric['en-IN'] = alphanumeric['en-US'];
alphanumeric['en-NZ'] = alphanumeric['en-US'];
alphanumeric['en-ZA'] = alphanumeric['en-US'];
alphanumeric['en-ZM'] = alphanumeric['en-US'];
Copy link
Collaborator

Choose a reason for hiding this comment

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

These could be de-duped with a loop.

var englishLocales = ['AU', 'GB', 'HK', 'IN', 'NZ', 'ZA', 'ZM'];
for (var locale, i = 0; i < englishLocales.length; i++) {
  locale = 'en-' + englishLocales[i];
  alpha[locale] = alpha['en-US'];
  alphanumeric[locale] = alphanumeric['en-US'];
}

Copy link
Contributor Author

Choose a reason for hiding this comment

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

True. 👍 Will update the commit now.

@oss92
Copy link
Contributor Author

oss92 commented Feb 9, 2016

I de-duped the method with the loop you've written. @chriso

@chriso
Copy link
Collaborator

chriso commented Feb 9, 2016

Awesome, thanks ✨

chriso added a commit that referenced this pull request Feb 9, 2016
Added aliases and custom locales error
@chriso chriso merged commit 122ce51 into validatorjs:master Feb 9, 2016
@oss92 oss92 deleted the locales_and_locales_error branch February 9, 2016 12:18
chriso added a commit that referenced this pull request Feb 9, 2016
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.

2 participants