Skip to content

Get locale helpers should return undefined #46

Open
@MickL

Description

@MickL

Clear and concise description of the problem

When using getHeaderLocale(event) or getCookieLocale(event) they will return the configurable fallback (default: 'en-US'). It would be great if they could (optionally) return undefined, too.

Usecase:
I would like to do a flow like this:

  1. Try detectLocaleFromAcceptLanguageHeader(event), if none is set:
  2. Try getCookieLocale(event), if none is set:
  3. Use default fallback locale

Suggested solution

They could accept undefined as a fallback: getHeaderLocale(event, { name: undefined })

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    featureIncludes new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions