Skip to main content

IntlHelpers

@forge/monorepo


@forge/monorepo / frontend/src / IntlHelpers

Type Alias: IntlHelpers

IntlHelpers = object

Defined in: frontend/src/localization.ts:10

Localization — docs/14-localization.md. The frontend owns all localization; the backend only ever emits stable machine ids + structured params. This module resolves an id to a display string for the active locale, interpolates the event's params, falls back cleanly (requested locale → default locale → the raw id, never a blank), and lets a consuming app merge its own catalog over the built-in one. Catalog entries are data (strings with {param} placeholders) or, for anything a placeholder can't express (plurals, locale-aware number/date), a function fed Intl helpers.

Properties

locale

readonly locale: string

Defined in: frontend/src/localization.ts:11


timezone?

readonly optional timezone?: string

Defined in: frontend/src/localization.ts:12

Methods

dateTime()

dateTime(value, options?): string

Defined in: frontend/src/localization.ts:14

Parameters

value

string | number | Date

options?

DateTimeFormatOptions

Returns

string


number()

number(value, options?): string

Defined in: frontend/src/localization.ts:13

Parameters

value

number

options?

NumberFormatOptions

Returns

string


plural()

plural(count, forms): string

Defined in: frontend/src/localization.ts:15

Parameters

count

number

forms

object & Record<string, string>

Returns

string