Sitecore 5.0 API

Item.Language Property

Gets the language of the item.

[Visual Basic]
Public ReadOnly Property Language As Language
[C#]
public Sitecore.Globalization.Language Language {get;}

Remarks

A language defines an aspect of an item, that relates to a spoken language. A content item can have content in multiple languages and there may be multiple versions of an item in a given language. The language name may be an abitrary string, but is recommended to use the ISO code of the language.

Example

This example gets the french text field of an item.

public string GetFrenchText(ID id) {
  Language language = Language.Parse("fr");

  Item item = Sitecore.Context.Database.Items[id, language];

  if (item != null) {
    return item["Text"];
  }

  return "";
}

See Also

Item Class | Sitecore.Data.Items Namespace