Open
Description
Clear and concise description of the problem
At the moment number formats need to be defined for every locale, but this results in duplicate code:
numberFormats: {
de: {
currency: {
style: 'currency',
currency: 'EUR',
},
},
fr: {
currency: {
style: 'currency',
currency: 'EUR',
},
},
es: {
currency: {
style: 'currency',
currency: 'EUR',
},
},
},
datetimeFormats: {
de: {
date: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
},
},
fr: {
date: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
},
},
es: {
date: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
},
},
},
This is a simple example but imagine having 27 EU countries and defining multiple date formats and all of them are the same.
Suggested solution
Maybe something like this:
numberFormats: {
currency: {
style: 'currency',
currency: 'EUR',
locales: ['de', 'fr', 'es'],
},
},
datetimeFormats: {
date: {
year: 'numeric',
month: '2-digit',
day: '2-digit',
locales: ['de', 'fr', 'es'],
},
},
Additionally locales
could be optional: If not defined it applies to all locales.
Alternative
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.