Skip to content

Constraint: Locale (BCP 47) #113

Description

@cursor

Goal

Add a Locale constraint — validate a string as a correct locale in Symfony's sense (Assert\Locale), typically BCP 47 with a region.

Reference

  • Symfony: Symfony\Component\Validator\Constraints\Locale.

Constraints

  • No new dependencies in go.mod — use golang.org/x/text/language (already present): parse and validate the tag, optional allowlist as in the reference.

Scope

  • Document semantic differences from the Language constraint (see related Language issue) in the API description; tests.

Complexity

2 / 5.


Migrated from Linear: IGO-41
Priority: High
Estimate: 2 points

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions