Skip to main content
Home  › ... 2sxc Apps

CmsContext Tutorials

Tutorial Home

Interface ICmsCulture

With this object you can get general information about the culture.

The .CurrentCode attribute:

The current code culture is: en-us

  <h3>The .CurrentCode attribute:</h3>
  The current code culture is: 
  <strong>
    @CmsContext.Culture.CurrentCode
  </strong>

The .DefaultCode attribute:

The default culture for the system is: en-us

  <h3>The .DefaultCode attribute:</h3>
  The default culture for the system is: 
  <strong>
    @if(Text.Has(CmsContext.Culture.DefaultCode)){
      @CmsContext.Culture.DefaultCode
    } else {
      <p>
        The system is single language and the response is an empty string.
      </p>
    }
  </strong>

Source Code of this file

Below you'll see the source code of the file. Note that we're just showing the main part, and hiding some parts of the file which are not relevant for understanding the essentials. Click to expand the code

@inherits Custom.Hybrid.Razor14
@using ToSic.Razor.Blade;

<!-- unimportant stuff, hidden -->

Interface ICmsCulture With this object... <!-- unimportant stuff, hidden -->


  <h3>The .CurrentCode attribute:</h3>
  The current code culture is: 
  <strong>
    @CmsContext.Culture.CurrentCode
  </strong>




  <h3>The .DefaultCode attribute:</h3>
  The default culture for the system is: 
  <strong>
    @if(Text.Has(CmsContext.Culture.DefaultCode)){
      @CmsContext.Culture.DefaultCode
    } else {
      <p>
        The system is single language and the response is an empty string.
      </p>
    }
  </strong>



<!-- unimportant stuff, hidden -->