Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

feature: Allow multiple/all locales for isAlpha and IsAlphanumeric decorator #2232

Closed
Alfagun74 opened this issue Sep 5, 2023 · 2 comments
Closed
Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.

Comments

@Alfagun74
Copy link

Alfagun74 commented Sep 5, 2023

Description

I validate the Name Field using IsAlpha(). German users need Umlauts (ä,ö,ü, etc.), so I've set it to IsAlpha("de-DE"). Now, Spanish users are requesting (ó,ú,á), and tomorrow, Turkish users may request their special characters. I need a solution for this.

Proposed Solution

We can consider using an array of locales to allow, for example, IsAlpha(["de", "es"]), or a more inclusive approach, such as allowing all locales with IsAlpha("all").

Question

Is there a better decorator for handling names? What if the name is Arabic or Chinese, and not Latin at all? I'm quite curious.

Related: #266

@Alfagun74 Alfagun74 added flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features. labels Sep 5, 2023
@Z4nR
Copy link

Z4nR commented Oct 27, 2023

I thing that is a great idea, so some app or framework using class-validator and have a global user don't need to write every naming styling in decorator

@braaar
Copy link
Member

braaar commented Jan 11, 2024

I'm moving this to the discussion tab, as we are trying to keep the issue count low. Please see this issue for an explanation.

@typestack typestack locked and limited conversation to collaborators Jan 11, 2024
@braaar braaar converted this issue into discussion #2366 Jan 11, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
flag: needs discussion Issues which needs discussion before implementation. type: feature Issues related to new features.
Development

No branches or pull requests

3 participants