Skip to content

bug: Potentially unexpected output given the "*" operator #361

@dpchamps

Description

@dpchamps

While authoring #360, I noticed a potentially unexpected edge case while using the * operator:

Let's say I'm authoring some messages, and I want to be overly terse:

const messagePacks = {
    "en": {
      es: "Estimation Date: {date, date, ::EEEMMMd}",
      fi: "Financial Incentive Date: {date, date, ::EEEMMMd}",
    },
  };

If I were to compile this against the new MessageFormat("*") invocation, I'm going to get very unexpected output. Namely, spanish and finnish localized dates.

See the repro here: https://github.com/dpchamps/mf-locale-collision-repro

Idea for a fix: we could add an optional arg to compile to indicate isRecursing, and then not pull from the plurals at all.

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