Language

Represents a Language. Installed languages can be found in the settings section.

Represents a Language. Installed languages can be found in the settings section.

  • Namespace: Umbraco.Cms.Core.Models

  • Assembly: Umbraco.Core.dll

All samples in this document will require references to the following dll:

  • Umbraco.Core.dll

All samples in this document will require the following using statement:

using Umbraco.Cms.Core.Models;

Constructors

new Language(GlobalSettings globalSettings, string isoCode)

Constructor for creating a new Language object where the necessary parameter are the global settings as GlobalSettings and the isoCode as a string.

To create a new Language the global setting parameter is necessary. You can find more info about how to use configuration in code in the Config article.

Properties

.CultureInfo

Gets the CultureInfo object for the language.

.CultureName

Gets or sets the culture name of the language.

.FallbackLanguageId

Gets or sets the identifier of a fallback language. The fallback language can be used in multi-lingual scenarios, to help define fallback strategies when a value does not exist for a requested language.

.IsDefault

Gets or sets a value indicating whether the language is the default language.

.IsMandatory

Gets or sets a value indicating whether the language is mandatory. When a language is mandatory, a multi-lingual document cannot be published without that language being published, and unpublishing that language unpublishes the entire document.

.IsoCode

Gets or sets the ISO code of the language.

Last updated