Skip to main content
Version: Next

Locale

locale

Gets the localization context. If the context originates from the event worker context, the returned t function is not bound to the command.

Example

const { t, locale, i18n } = locale('en-US');
const translated = t('hello'); // Translates 'hello' in the 'en-US' locale
Signature
function locale(locale?: Locale): CommandLocalizationContext

Parameters

locale

parameter
Locale