Skip to content

[RFC] [Validator] Suggest to apply \Locale::canonicalize() before validating with Locale constraint #7660

Closed
@phansys

Description

@phansys

It would be nice to have a note about \Locale::canonicalize() within the Locale constraint documentation, since many times locales are expressed using other "uncanonicalized" formats. By instance, a common use case is to infer the locale from javascript, where navigator.language returns values like "en-US" instead of "en_US"; making the Locale constraint to fail.
The canonicalization process is explained at ICU project.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions