LanguageExtensionMethods

public static class LanguageExtensionMethods
Utility class for language and language family and language region logic.

Properties

LinguisticFamilies

#
public static IEnumerable<(LanguageFamily family, bool primary)> LinguisticFamilies { get; }
Enumerate over all linguistic families.

LinguisticRegions

#
public static IEnumerable<(LanguageRegion primary, LanguageRegion secondary)> LinguisticRegions { get; }
Enumerate over all linguistic geographic regions.

Methods

FindFamily

#Example
public static LanguageFamily FindFamily(this Language language)
Find the family which contains the given language.
language (Language)

FindRegion

#Example
public static (LanguageRegion primary, LanguageRegion secondary) FindRegion(this Language language)
Find the family which contains the given language.
language (Language)
public static CultureInfo Info(this Language language)
Create the CultureInfo object associated with the specified language. Note: there is no culture information for the ordinal language.
language (Language)

Languages

#Example
public static IEnumerable<Language> Languages(this LanguageFamily family)
Enumerate over all languages which belong to a specific family.
family (LanguageFamily)

Languages

#Example
public static IEnumerable<Language> Languages(this LanguageRegion region)
Enumerate over all languages which belong to a specific region.
region (LanguageRegion)

StringComparison

#Example
public static int StringComparison(this Language language, string a, string b, CompareOptions options = CompareOptions.None)
Compare two strings using the language rules.
language (Language)Language rules.
a (string)First text.
b (string)Second text.
options (CompareOptions = CompareOptions.None)Options for comparison.
Comparison key.

StringEquality

#Example
public static bool StringEquality(this Language language, string a, string b, CompareOptions options = CompareOptions.None)
Test two strings for equality using the language rules.
language (Language)Language rules.
a (string)First text.
b (string)Second text.
options (CompareOptions = CompareOptions.None)Options for equality.
True if strings are equal.

StringLength

#Example
public static int StringLength(this Language language, string text)
Measure the number of final characters in a string. This method will count combining characters as one.
language (Language)
text (string)

StringLowercase

#Example
public static string StringLowercase(this Language language, string text)
Lower case a string.
language (Language)
text (string)

StringOrdering

#Example
public static Maths.IndexMap StringOrdering(this Language language, string[] keys, CompareOptions options = CompareOptions.None)
Create a sorting map for an array of strings.
language (Language)Language rules.
keys (string[])String keys to sort. This array will not be modified.
options (CompareOptions = CompareOptions.None)Comparison options to use during sorting.
Sorting map.

StringUppercase

#Example
public static string StringUppercase(this Language language, string text)
Upper case a string.
language (Language)
text (string)

ToFlag

#Example
public static IIcon ToFlag(this Language language)
Gets the flag icon associated with a particular language. Not every language has a flag, either because it doesn't represent a nation state, or because it overlaps several states with competing flags.
language (Language)

ToString

#Example
public static string ToString(this Language language, bool includeDetails)
Create a string descriptor of this language.
language (Language)
includeDetails (bool)If true, the LCID and native name will be included.