Skip to content

Add a method for Intl.ListFormat #2323

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

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions