Avoid duplicate code for `numberFormats` and `dateTimeFormats `
Author: MickLCreated Jan 24, 2024Updated Oct 18, 2024
LabelsStatus: Proposal
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
- 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.
Source: kazupon/vue-i18n