Table of Contents

Interface ICmsCulture

Namespace
ToSic.Sxc.Context
Assembly
ToSic.Sxc.dll

Information about the cultures/languages used.

🪒 In Dynamic Razor it's found on CmsContext.Culture
🪒 In Typed Razor it's found on MyContext.Culture

[PublicApi]
public interface ICmsCulture

Properties

CurrentCode

The current culture / language code like "de-ch". It's the language-code used by the translation environment.

🪒 Use in Dynamic Razor: CmsContext.Culture.CurrentCode
🪒 Use in Typed Razor: MyContext.Culture.CurrentCode

string CurrentCode { get; }

Property Value

string

Remarks

  1. It's always lower-case.
  2. In the case of DNN, this corresponds to PortalSettings.CurrentAlias.CultureCode

DefaultCode

The default language code like "en-us" or "" (empty string). If the system is single-language, it will often just be an empty string "".

🪒 Use in Dynamic Razor: CmsContext.Culture.DefaultCode
🪒 Use in Typed Razor: MyContext.Culture.DefaultCode

string DefaultCode { get; }

Property Value

string

Remarks

  1. It's always lower-case.
  2. In the case of DNN, this corresponds to PortalSettings.DefaultCulture