Skip to main content

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.

NameTypeDefaultRequiredDescription
keystringyesMessage key, for example timeout; an unknown key is returned as is.
localeLocale"en"noLanguage, en by default; a key missing in fr falls back to en.
paramsRecord<string, unknown>{}noExtra 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.

NameTypeDefaultRequiredDescription
localeLocaleyesen or fr.

Returns: Readonly<Record<string, string>>. Read-only map of message keys to templates.