Skip to content

Kitto.Web.Handler.SetLang ​

Anonymous endpoint backing the LanguageSwitcher controller. Sets the interface language for the current session and returns an empty 200; the client (kxlang.js) then reloads the page so the whole UI re-renders in the new language via the per-session gettext instance.

It is [TKXAnonymous] because the switcher lives on the Login view too, so an unauthenticated visitor must be able to change language before signing in. The requested id is validated against TKXLanguageCatalog.IsAvailable, so a crafted /kx/setlang/xx can only ever select a language the app actually ships — it can never inject an arbitrary value into the session.

TKXSetLangHandler class ​

Sets the per-session interface language (validated) so the next page load renders in that language.

pascal
procedure HandleSetLang([TKXPathParam('Lang')] const ALang: string);

Sets the session language to Lang when it is one of the languages the application ships (else leaves it unchanged) and returns an empty 200 for the client to reload on.

Released under Apache License, Version 2.0.