Skip to content

Language manager

Alexanderius edited this page Jun 7, 2024 · 3 revisions

Language manager

LanguageManager is the class which provides current language info, functionality to change current request/user language.

Properties and methods

  • Language - current request language;
  • SetCookieLanguage("en") - creates cookie language variable, which will be used on a next requests and will set user request language;
  • SetCurrentLanguage("en") - sets language only for the current request.

Logic of setting language by framework

On begin request:

  1. Set language from cookie if AcceptCookieLanguage settings is set to true;
  2. If there is no cookie language and Simplify.Web configuration AcceptHeaderLanguage is set to true then HTTP request header language will be used;
  3. If header language usage is disabled, then the default language from Simplify.Web configuration will be used instead.
  4. If there is an error setting default language then invariant language will be used instead.

<< Previous page Next page >>

Clone this wiki locally