Skip to content

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

Closed

Description

@Alfagun74

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

Activity

  1. Z4nR commented on Oct 27, 2023

    @Z4nR

    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

  2. braaar commented on Jan 11, 2024

    @braaar
    Member

    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.

  3. locked and limited conversation to collaborators on Jan 11, 2024
  4. converted this issue into a discussion #2366 on Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    flag: needs discussionIssues which needs discussion before implementation.type: featureIssues related to new features.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions