Language manager - SimplifyNet/Simplify.Web GitHub Wiki
Language manager
LanguageManager is a class that provides current language information and functionality to change the current request or user language.
Properties and methods
Language- current request languageSetCookieLanguage("en")- creates a cookie language variable, which will be used on the next requests and will set the user request languageSetCurrentLanguage("en")- sets language only for the current request
Logic of setting language by the framework
On begin request:
- Set language from cookie if the
AcceptCookieLanguagesetting is set totrue. - If there is no cookie language and Simplify.Web configuration
AcceptHeaderLanguageis set totrue, then the HTTP request header language will be used. - If header language usage is disabled, then the default language from Simplify.Web configuration will be used instead.
- If there is an error setting the default language, then the invariant language will be used instead.