Skip to content

StdLib Intl

Roger Johansson edited this page Jan 14, 2026 · 1 revision

Intl (Internationalization)

Locale-sensitive formatting and comparison functionality.

Implementation Status: ~80% Complete

Overview

Type Status Description
Intl.Locale 100% Locale identification and negotiation
Intl.Collator 100% String comparison
Intl.DateTimeFormat 100% Date/time formatting
Intl.NumberFormat 100% Number formatting
Intl.RelativeTimeFormat Basic Relative time (simplified output)
Intl.DisplayNames 100% Display names for languages, etc.
Intl.DurationFormat Stub Duration formatting (not functional)
Intl.PluralRules Not Implemented Plural category selection
Intl.ListFormat Not Implemented List formatting
Intl.Segmenter Not Implemented Text segmentation

Global Intl Methods

Method Status Description
Intl.getCanonicalLocales(locales) Implemented Canonicalizes locale tags
Intl.supportedValuesOf(key) Implemented Returns supported values

Supported keys for supportedValuesOf: calendar, collation, currency, numberingSystem, timeZone, unit


Intl.Locale

Status: 100% Complete

new Intl.Locale(tag, options)

Properties (Getters)

Property Status Description
baseName Implemented Language-script-region
language Implemented Language subtag
script Implemented Script subtag
region Implemented Region subtag
variants Implemented Variant subtags array
calendar Implemented From Unicode extension
numberingSystem Implemented From Unicode extension
collation Implemented From Unicode extension
hourCycle Implemented From Unicode extension
caseFirst Implemented From Unicode extension
numeric Implemented From Unicode extension
firstDayOfWeek Implemented Uses week data

Methods

Method Status Description
toString() Implemented Returns locale string
maximize() Implemented Adds likely subtags
minimize() Implemented Removes likely subtags
getCalendars() Implemented Available calendars
getCollations() Implemented Available collations
getHourCycles() Implemented Available hour cycles
getNumberingSystems() Implemented Available numbering systems
getTextInfo() Implemented Text direction info
getTimeZones() Implemented Time zones for region
getWeekInfo() Implemented Week info (firstDay, weekend)

Intl.Collator

Status: 100% Complete

new Intl.Collator(locales, options)

Methods

Method Status Description
compare(a, b) Implemented Returns -1, 0, or 1
resolvedOptions() Implemented Returns resolved options

Options

Option Values
usage "sort", "search"
sensitivity "base", "accent", "case", "variant"
ignorePunctuation boolean
numeric boolean
caseFirst "upper", "lower", "false"
collation Various collation types

Intl.DateTimeFormat

Status: 100% Complete

new Intl.DateTimeFormat(locales, options)

Methods

Method Status Description
format(date) Implemented Formats date
formatToParts(date) Implemented Returns parts array
formatRange(start, end) Implemented Formats date range
formatRangeToParts(start, end) Implemented Range parts array
resolvedOptions() Implemented Returns resolved options

Options

Option Values
dateStyle "full", "long", "medium", "short"
timeStyle "full", "long", "medium", "short"
calendar Various calendars
numberingSystem Various systems
timeZone Time zone identifier
hourCycle "h11", "h12", "h23", "h24"
weekday "long", "short", "narrow"
era "long", "short", "narrow"
year "numeric", "2-digit"
month "numeric", "2-digit", "long", "short", "narrow"
day "numeric", "2-digit"
hour "numeric", "2-digit"
minute "numeric", "2-digit"
second "numeric", "2-digit"

Intl.NumberFormat

Status: 100% Complete

new Intl.NumberFormat(locales, options)

Methods

Method Status Description
format(number) Implemented Formats number
formatToParts(number) Implemented Returns parts array
resolvedOptions() Implemented Returns resolved options

Options

Option Values
style "decimal", "currency", "percent", "unit"
currency ISO 4217 codes
currencyDisplay "code", "symbol", "narrowSymbol", "name"
currencySign "standard", "accounting"
unit Unit identifiers
unitDisplay "short", "narrow", "long"
notation "standard", "scientific", "engineering", "compact"
signDisplay "auto", "never", "always", "exceptZero"
useGrouping boolean or "always", "auto", "min2"
minimumIntegerDigits 1-21
minimumFractionDigits 0-20
maximumFractionDigits 0-20
minimumSignificantDigits 1-21
maximumSignificantDigits 1-21

Intl.RelativeTimeFormat

Status: Basic Implementation

new Intl.RelativeTimeFormat(locales, options)

Methods

Method Status Description
format(value, unit) Basic Returns simplified format
formatToParts(value, unit) Basic Returns single literal part
resolvedOptions() Implemented Returns resolved options

Note: Output is simplified (e.g., "2 day" instead of "in 2 days").


Intl.DisplayNames

Status: 100% Complete

new Intl.DisplayNames(locales, { type: "language" })

Methods

Method Status Description
of(code) Implemented Returns display name
resolvedOptions() Implemented Returns resolved options

Type Values

language, region, script, currency, calendar, dateTimeField


Not Implemented

Type Description
Intl.PluralRules Plural category selection
Intl.ListFormat List formatting ("A, B, and C")
Intl.Segmenter Text segmentation
Intl.DurationFormat Duration formatting (stub only)

Files

File Purpose
StdLib/Intl/IntlHelper.cs Main Intl object
StdLib/Intl/IntlLocaleConstructor.cs Locale constructor
StdLib/Intl/IntlCollatorConstructor.cs Collator constructor
StdLib/Intl/IntlDateTimeFormatConstructor.cs DateTimeFormat
StdLib/Intl/IntlNumberFormatConstructor.cs NumberFormat
StdLib/Intl/IntlNumberFormatter.cs Number formatting logic
StdLib/Intl/IntlUtilities.cs Locale utilities

See Also

Clone this wiki locally