Show / Hide Table of Contents

Class CultureUtilities

Provides methods for working with culture.

Inheritance
System.Object
CultureUtilities
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Terrasoft.Core
Assembly: Terrasoft.Core.dll
Syntax
public static class CultureUtilities

Methods

GetCultureWithoutPriority(String)

Returns culture without priority.

Declaration
public static string GetCultureWithoutPriority(string contextCulture)
Parameters
Type Name Description
System.String contextCulture

Culture with priority.

Returns
Type Description
System.String

Culture without priority.

GetPriorityContextCulture(String[], CultureInfo)

Returns context culture by priority if culture exists in GeneralResourceStorage.

Declaration
public static CultureInfo GetPriorityContextCulture(string[] userLanguages, CultureInfo defaultCulture)
Parameters
Type Name Description
System.String[] userLanguages

Context languages.

System.Globalization.CultureInfo defaultCulture

Default culture.

Returns
Type Description
System.Globalization.CultureInfo

Context culture by priority if culture exists, otherwise default culture.

GetUserCultureFromAuthCookie(HttpContext)

Returns culture from authentication cookie if cookie exists.

Declaration
[Obsolete("7.14.3 | Method is not in use and will be removed in upcoming releases")]
public static CultureInfo GetUserCultureFromAuthCookie(HttpContext context)
Parameters
Type Name Description
System.Web.HttpContext context

Http context.

Returns
Type Description
System.Globalization.CultureInfo

Culture from authentication cookie, otherwise null.

SetContextCultureToGeneralStorage(String[], CultureInfo)

Sets context culture to GeneralResourceStorage as the current culture.

Declaration
public static CultureInfo SetContextCultureToGeneralStorage(string[] userLanguages, CultureInfo userCulture)
Parameters
Type Name Description
System.String[] userLanguages

Context languages.

System.Globalization.CultureInfo userCulture

Current user culture.

Returns
Type Description
System.Globalization.CultureInfo

Context culture by priority.

TryCreateSpecificCulture(String)

Tries to create a System.Globalization.CultureInfo that represents the specific culture that is associated with the specified name.

Declaration
public static CultureInfo TryCreateSpecificCulture(string culture)
Parameters
Type Name Description
System.String culture

Culture name.

Returns
Type Description
System.Globalization.CultureInfo

Specific culture name.

Back to top Generated by DocFX