Skip to content

Regression in v25.3.0: Intl.Locale causes i18next.dir() to throw an error with non-standard language codes like "en_US" #2330

@ziloen

Description

@ziloen

💥 Regression Report

Intl.Locale breaks the use of non-standard language codes like "en_US".

const l = new Intl.Locale(lng)

Last working version

Worked up to version: 25.2.0

Stopped working in version: 25.3.0

To Reproduce

Steps to reproduce the behavior:

i18next.dir("en_US")
// Uncaught RangeError: Incorrect locale information provided

Expected behavior

A clear and concise description of what you expected to happen.

i18next.dir("en_US")
// "ltr"

Your Environment

  • runtime version: Chrome 138
  • i18next version: 25.3.0

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