Skip to content

Add a method for Intl.ListFormat #2323

@edimitchel

Description

@edimitchel

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions