Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,78 @@
import { formatDisplayName } from "../formatter/formatter.js";
import type { DisplayNameStyle } from "../formatter.types.js";
/**
* Format an ISO 639 language code as a localised language name.
* Pre-binds `formatDisplayName` with `type: "language"`.
*/
export function formatLanguageName(
code: string,
locale: string,
style?: DisplayNameStyle
): string {
return formatDisplayName(code, locale, {
type: "language",
...(style !== undefined ? { style } : {}),
});
}
/**
* Format an ISO 3166 region code as a localised region/country name.
* Pre-binds `formatDisplayName` with `type: "region"`.
*/
export function formatRegionName(
code: string,
locale: string,
style?: DisplayNameStyle
): string {
return formatDisplayName(code, locale, {
type: "region",
...(style !== undefined ? { style } : {}),
});
}
/**
* Format an ISO 4217 currency code as a localised currency name.
* Pre-binds `formatDisplayName` with `type: "currency"`.
*/
export function formatCurrencyName(
code: string,
locale: string,
style?: DisplayNameStyle
): string {
return formatDisplayName(code, locale, {
type: "currency",
...(style !== undefined ? { style } : {}),
});
}
/**
* Format an ISO 15924 script code as a localised script name.
* Pre-binds `formatDisplayName` with `type: "script"`.
*/
export function formatScriptName(
code: string,
locale: string,
style?: DisplayNameStyle
): string {
return formatDisplayName(code, locale, {
type: "script",
...(style !== undefined ? { style } : {}),
});
}
/**
* Format a calendar identifier (`"gregory"`, `"buddhist"`, `"islamic"`,
* etc.) as a localised calendar name. Pre-binds `formatDisplayName`
* with `type: "calendar"`.
*/
export function formatCalendarName(
code: string,
locale: string,
style?: DisplayNameStyle
): string {
return formatDisplayName(code, locale, {
type: "calendar",
...(style !== undefined ? { style } : {}),
});
}