Table of Contents

Class AppLangHelper

Namespace
SunamoLang.SunamoI18N
Assembly
SunamoLang.dll

Helper class for application language settings and culture management.

public static class AppLangHelper
Inheritance
AppLangHelper
Inherited Members

Properties

CurrentCulture

Gets or sets the current culture information.

public static CultureInfo? CurrentCulture { get; set; }

Property Value

CultureInfo

CurrentUICulture

Gets or sets the current UI culture information.

public static CultureInfo? CurrentUICulture { get; set; }

Property Value

CultureInfo

SelectedInComboBox

Gets or sets the currently selected language in the combo box.

public static AppLang? SelectedInComboBox { get; set; }

Property Value

AppLang

Methods

GetCultureInfo(Langs)

Returns the CultureInfo for the specified language.

public static CultureInfo GetCultureInfo(Langs lang)

Parameters

lang Langs

The language enum value.

Returns

CultureInfo

The corresponding CultureInfo instance.

GetLang(CultureInfo)

Returns the Langs enum value based on the provided CultureInfo.

public static Langs GetLang(CultureInfo cultureInfo)

Parameters

cultureInfo CultureInfo

The CultureInfo to extract language from.

Returns

Langs

The corresponding Langs enum value.

GetLang(string)

Returns the language in which content should be displayed. Supports both two-letter and five-letter (e.g., en-US) language codes.

public static Langs GetLang(string text)

Parameters

text string

The language code string.

Returns

Langs

The corresponding Langs enum value.

GetLang3(string)

Returns the language enum value from either a two-letter or five-letter language code.

public static Langs GetLang3(string languageCode)

Parameters

languageCode string

The language code (e.g., "en" or "en-US").

Returns

Langs

The corresponding Langs enum value.

ItemsToAddToComboBox(string)

Returns a list of AppLang items to populate a language selection ComboBox.

public static List<AppLang> ItemsToAddToComboBox(string settingsAppLang)

Parameters

settingsAppLang string

The current language settings string.

Returns

List<AppLang>

A list of AppLang items for the ComboBox.

ToString(AppLang)

Returns the language name for display (e.g., in a ComboBox for language selection). If the language type is not fixed, returns the appropriate text based on OS language.

public static string ToString(AppLang appLang)

Parameters

appLang AppLang

The current AppLang instance.

Returns

string

The display name for the language.