Documentation / @zerotal/i18n / LocaleMiddleware
Class: LocaleMiddleware
Defined in: i18n/src/LocaleMiddleware.ts:13
Resolves the request locale, exposes ctx.locale + ctx.t(), and runs the
rest of the pipeline inside I18nContext.run() so the Lang facade and the
global t() helper see the right locale. Configured by I18nProvider via
LocaleMiddleware.configure() and registered with app.useOnce().
Implements
Constructors
Constructor
new LocaleMiddleware():
LocaleMiddleware
Returns
LocaleMiddleware
Methods
configure()
staticconfigure(translator,config):void
Defined in: i18n/src/LocaleMiddleware.ts:17
Parameters
translator
config
Returns
void
handle()
handle(
http,next):Promise<void|Response>
Defined in: i18n/src/LocaleMiddleware.ts:22
Parameters
http
next
Returns
Promise<void | Response>