Skip to content
This repository was archived by the owner on Dec 31, 2024. It is now read-only.
This repository was archived by the owner on Dec 31, 2024. It is now read-only.

Avoid duplicate code for numberFormats and dateTimeFormats  #1694

@MickL

Description

@MickL

Clear and concise description of the problem

Currently numberFormats and dateTimeFormats need to be set for each language separately:

numberFormats: {
    de: {
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    },
    nl: {
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    es: {
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    },
    fr: {
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    },
    pt: {
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    },
  },

This results in duplicate code for countries that share the same currency or date-time-format (common within in the EU).

Suggested solution

It would be nice to group them somehow, for example:

numberFormats: [
    {
      locales: ['de', 'nl', 'es', 'fr', 'pt'],
      currency: {
        style: 'currency',
        currency: 'EUR',
      },
    },
  ],

Or in some other way.

Alternative

No response

Additional context

No response

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions