Gets or sets the ISO language code the the current client language.
The current client language ISO code.
The client language is the language that the Sitecore client is presented in. For instance if the client language is "da" the client will present all menus, toolbars etc. in the Danish language.
The client language code is usually set when the user logs in. The language code for a user is specified in the Client Language field on the __User template.
If the language code is changed, the Sitecore client must be reloaded in order to retrieve the new language from the server.
The scope of the value is session and it is stored in the Session variable "SC_CLIENT_LANGUAGE".
The following example checks the client language to provide the correct text.
public string GetWelcomeText() {
if (State.ClientLanguage == "da") {
return "Velkommen";
}
return "Welcome";
}
State Class | Sitecore.Configuration Namespace | Language