Variable DisplayNames
DisplayNames: {
prototype: Intl.DisplayNames;
supportedLocalesOf(
locales?: LocalesArgument,
options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher },
): string[];
new (
locales: LocalesArgument,
options: DisplayNamesOptions,
): Intl.DisplayNames;
}
prototype: Intl.DisplayNames;
supportedLocalesOf(
locales?: LocalesArgument,
options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher },
): string[];
new (
locales: LocalesArgument,
options: DisplayNamesOptions,
): Intl.DisplayNames;
}
Type declaration
- new (locales: LocalesArgument, options: DisplayNamesOptions): Intl.DisplayNames
Parameters
- locales: LocalesArgument
- options: DisplayNamesOptions
An object for setting up a display name.
MDN.
Returns Intl.DisplayNames
prototype: Intl.DisplayNames
supportedLocalesOf:function
- supportedLocalesOf(
locales?: LocalesArgument,
options?: { localeMatcher?: RelativeTimeFormatLocaleMatcher },
): string[] Returns an array containing those of the provided locales that are supported in display names without having to fall back to the runtime's default locale.
Parameters
Optional
locales: LocalesArgumentA string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the
locales
argument, see the Intl page.Optional
options: { localeMatcher?: RelativeTimeFormatLocaleMatcher }An object with a locale matcher.
Returns string[]
An array of strings representing a subset of the given locale tags that are supported in display names without having to fall back to the runtime's default locale.
MDN.
- supportedLocalesOf(
A string with a BCP 47 language tag, or an array of such strings. For the general form and interpretation of the
locales
argument, see the Intl page.