Skip to content

The PluralRules locale sr-Latn does not exist but is returned from intl-localeMatcher #3058

@JakeChampion

Description

@JakeChampion

Which package?

Since this is a monorepo. Please specify which package this bug report is for.
This bug report is for packages:

  • @formatjs/intl-localematcher
  • @formatjs/intl-pluralrules

Describe the bug

When called the @formatjs/intl-localematcher package with sr-Latn-BA and the locales from @formatjs/intl-pluralrules/locale-data, it returns sr-Latn as the match but that locale does not exist

To Reproduce

Reproducible Steps/Repo

Steps to reproduce the behavior:

  1. Clone the GitHub Repository JakeChampion/intl-bug
  2. Run npm ci to install the same dependency versions I used
  3. Run npm start to execute the program
  4. You should see in the console:

The detected PluralRules Locale dependency for sr-Latn-BA is sr-Latn
Does the PluralRules locale dependency file exist? Answer: false

Expected behavior

The matched locale should be one which exists within @formatjs/intl-pluralrules/locale-data, most likely the locale sr.js

Desktop (please complete the following information):

  • OS: MacOS 10.15.7

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