Table of Contents

Class Language

Namespace
Dynamicweb.Ecommerce.International
Assembly
Dynamicweb.Ecommerce.dll
Represents the language.
[Serializable]
public class Language : ICloneable, IDisplayName, IPermissionLookup, IPermissionControlled
Inheritance
Language
Implements
Inherited Members

Constructors

Language()

Initializes a new instance of the class.
public Language()

Language(IDataReader)

Initializes a new instance of the class.
[Obsolete("This method is no longer used.")]
public Language(IDataReader dataReader)

Parameters

dataReader IDataReader
The data reader.

Properties

Code

Gets the two-letter ISO language code, e.g. "en".
public string Code { get; }

Property Value

string

Remarks

Use Culture to change the value of Code and CountryCode.

Code2

[Obsolete("Use CountryCode instead.")]
public string Code2 { get; set; }

Property Value

string

CountryCode

Gets the two-letter ISO country code, e.g. "US".
public string CountryCode { get; }

Property Value

string

Remarks

Use Culture to change the value of Code and CountryCode.

Culture

Gets or sets the culture name (IETF language tag), e.g. "en-US".
public string Culture { get; set; }

Property Value

string

Remarks

Setting this value will also change the value of Code and CountryCode.

IsDefault

Gets or sets value indicating whether the language is default.
public bool IsDefault { get; set; }

Property Value

bool

LanguageId

Gets or sets the language ID.
public string LanguageId { get; set; }

Property Value

string

Name

Gets or sets the language name.
public string Name { get; set; }

Property Value

string

NativeName

Gets or sets the native name.
public string NativeName { get; set; }

Property Value

string

Methods

ClearCachedLanguages()

Clears cached languages.
[Obsolete("Use LanguageService.ClearCache instead.")]
public static void ClearCachedLanguages()

ClearLanguageCache()

Clears cached in-memory languages.
[Obsolete("Use LanguageService.ClearCache instead.")]
public static void ClearLanguageCache()

Clone()

public object Clone()

Returns

object

CreateEmpty(string)

Creates a new language.
[Obsolete("Use LanguageService.Save instead.")]
public static void CreateEmpty(string id)

Parameters

id string
The language ID.

Delete()

Deletes this instance.
[Obsolete("Use LanguageService.Delete instead.")]
public void Delete()

Delete(string)

Deletes an instance with the specified parameters.
[Obsolete("Use LanguageService.Delete instead.")]
public void Delete(string id)

Parameters

id string
The language ID.

DeleteAll()

Deletes all languages and translations.
[Obsolete("Use LanguageService.Delete instead.")]
public void DeleteAll()

Exists(string)

Determines whether specified language exists.
[Obsolete("Use LanguageService.GetLanguage instead.")]
public static bool Exists(string languageId)

Parameters

languageId string
An ID of the language.

Returns

bool
Value indicating whether specified language exists.

GetByKey(string)

Can be used to look up a concrete object based upon the key.
public IPermissionControlled GetByKey(string key)

Parameters

key string
Identifier

Returns

IPermissionControlled
permissionControlled

GetCultureInfo()

Gets the culture information.
public static CultureInfo GetCultureInfo()

Returns

CultureInfo
The culture information.

GetDefaultLanguage()

Loads the default language properties and sets them as the class properties.
[Obsolete("This method is no longer used. Use LanguageService.GetDefaultLanguage instead.")]
public void GetDefaultLanguage()

GetDisplayName()

Yields a human-readable name for rendering.
public string GetDisplayName()

Returns

string
name

GetLanguage(string)

Gets language with the specified ID.
[Obsolete("Use LanguageService.GetLanguage instead.")]
public static Language GetLanguage(string languageId)

Parameters

languageId string
The language ID.

Returns

Language
The language.

GetLanguages()

Gets all languages.
[Obsolete("Use LanguageService.GetLanguages instead.")]
public static LanguageCollection GetLanguages()

Returns

LanguageCollection
A collection of the Language.

GetParent()

Gets the parent of this object, for the purposes of inherited permissions.
public IPermissionControlled GetParent()

Returns

IPermissionControlled
parent

Remarks

Return null, if no parent permissions exist

GetPermissionIdentifier()

Combination of values that form a unique identifier.
public UnifiedPermissionIdentifier GetPermissionIdentifier()

Returns

UnifiedPermissionIdentifier
Unique identifier.

Lock()

Makes this inctance to read only.
[Obsolete("This method is no longer used.")]
public void Lock()

Save(string)

Saves an instance with the specified parameters.
[Obsolete("Use LanguageService.Save instead.")]
public void Save(string id)

Parameters

id string
The language id.

UpdateDefault(bool, string)

Changes the value of "LanguageIsDefault" property for specified language.
[Obsolete("Use LanguageService.CleanDefault or LanguageService.Save instead.")]
public void UpdateDefault(bool setDefaultTo, string id = "")

Parameters

setDefaultTo bool
New value for "LanguageIsDefault" property.
id string
The language ID.
To top