Clear and concise description of the problem
In order to ease usage of Intl.ListFormat with Vue i18n, I suggest to add a method $l which waits for 2 parameters where the second is optional.
This could avoid to boilerplate code thus passing the locale in the native method each time
Suggested solution
The method will use the native method Intl.ListFormat to display the array of string elements and join with the proper localized separator (, | and | or) for english.
So the method signature would be following:
function $l(list: string[], options?: Pick<ListFormatOptions, 'type' | 'style'> = { type: 'conjunction', style: 'long' }): string
Alternative
No response
Additional context
No response
Validations
Clear and concise description of the problem
In order to ease usage of Intl.ListFormat with Vue i18n, I suggest to add a method
$lwhich waits for 2 parameters where the second is optional.This could avoid to boilerplate code thus passing the locale in the native method each time
Suggested solution
The method will use the native method
Intl.ListFormatto display the array of string elements and join with the proper localized separator (, | and | or) for english.So the method signature would be following:
Alternative
No response
Additional context
No response
Validations