Documentation / @zerotal/i18n / I18nContext
Class: I18nContext
Defined in: i18n/src/I18nContext.ts:10
Constructors
Constructor
new I18nContext():
I18nContext
Returns
I18nContext
Methods
run()
staticrun<T>(locale,callback):T
Defined in: i18n/src/I18nContext.ts:12
Execute callback with locale as the active request locale.
Type Parameters
T
T
Parameters
locale
string
callback
() => T
Returns
T
current()
staticcurrent():string|undefined
Defined in: i18n/src/I18nContext.ts:17
The active request locale, or undefined outside a request boundary.
Returns
string | undefined