Register it globally (the plugin does, at priority 45) or per route group
when the plugin's own registration is disabled. On every path it does not
exclude it:
appends Vary: Accept-Language — plus Cookie while the cookie source is
enabled — before next(), unconditionally, because the response varies
by those headers whether or not they won this time;
writes the resolved tag through replaceLocale;
after next() resolves, sets Content-Language from the FINAL
ctx.request.locale, unless the response already carries one or the
final value is not a supported tag. A rejection from next() propagates
with no Content-Language written.
Creates the locale resolution middleware.
Register it globally (the plugin does, at priority 45) or per route group when the plugin's own registration is disabled. On every path it does not exclude it:
Vary: Accept-Language— plusCookiewhile the cookie source is enabled — beforenext(), unconditionally, because the response varies by those headers whether or not they won this time;replaceLocale;next()resolves, setsContent-Languagefrom the FINALctx.request.locale, unless the response already carries one or the final value is not a supported tag. A rejection fromnext()propagates with noContent-Languagewritten.