i18n.ts
Source: sdks/typescript/packages/sdk/src/i18n.ts. Back to the TypeScript SDK reference index.
note
This page is generated by tools/docs/gen_sdk_reference.py from the SDK sources and the OpenAPI text folders. Do not edit it by hand: change the source and regenerate.
Type alias Locale
Language of the SDK messages: en or fr.
Definition: "en" \| "fr".
Functions
t
t(key: string, locale: Locale = "en", params: Record<string, unknown> = {}): string
Translates a message key and fills its {name} placeholders.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
key | string | yes | Message key, for example timeout; an unknown key is returned as is. | |
locale | Locale | "en" | no | Language, en by default; a key missing in fr falls back to en. |
params | Record<string, unknown> | {} | no | Extra fields merged into the request. |
Returns: string. The message with the known parameters filled in.
messages
messages(locale: Locale): Readonly<Record<string, string>>
Gives the message catalog of a locale.
| Name | Type | Default | Required | Description |
|---|---|---|---|---|
locale | Locale | yes | en or fr. |
Returns: Readonly<Record<string, string>>. Read-only map of message keys to templates.