You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
13 lines
393 B
TypeScript
13 lines
393 B
TypeScript
import { getBrowserLocale } from '../shared';
|
|
|
|
/**
|
|
* @returns a Intl formatter that can be used to do ["Alice", "Bob"].join(', ') in a locale dependent way.
|
|
* i.e. the ', ' is not always what needs to be used to join strings together.
|
|
*/
|
|
export function getLocalizedStringListJoin() {
|
|
return new Intl.ListFormat(getBrowserLocale(), {
|
|
style: 'narrow',
|
|
type: 'conjunction',
|
|
});
|
|
}
|