Skip to main content
Version: 2.14.1

Humanizer.Configuration.LocaliserRegistry_TLocaliser_

LocaliserRegistry<TLocaliser> Class

A registry of localised system components with their associated locales

public class LocaliserRegistry<TLocaliser>
where TLocaliser : class

Type parameters

TLocaliser

Inheritance System.Object → LocaliserRegistry<TLocaliser>

Constructors

LocaliserRegistry(Func<CultureInfo,TLocaliser>) Constructor

Creates a localiser registry with the default localiser factory set to the provided value

public LocaliserRegistry(System.Func<System.Globalization.CultureInfo,TLocaliser> defaultLocaliser);

Parameters

defaultLocaliser System.Func<System.Globalization.CultureInfo,TLocaliser>

LocaliserRegistry(TLocaliser) Constructor

Creates a localiser registry with the default localiser set to the provided value

public LocaliserRegistry(TLocaliser defaultLocaliser);

Parameters

defaultLocaliser TLocaliser

Methods

LocaliserRegistry<TLocaliser>.Register(string, Func<CultureInfo,TLocaliser>) Method

Registers the localiser factory for the culture provided

public void Register(string localeCode, System.Func<System.Globalization.CultureInfo,TLocaliser> localiser);

Parameters

localeCode System.String

localiser System.Func<System.Globalization.CultureInfo,TLocaliser>

LocaliserRegistry<TLocaliser>.Register(string, TLocaliser) Method

Registers the localiser for the culture provided

public void Register(string localeCode, TLocaliser localiser);

Parameters

localeCode System.String

localiser TLocaliser

LocaliserRegistry<TLocaliser>.ResolveForCulture(CultureInfo) Method

Gets the localiser for the specified culture

public TLocaliser ResolveForCulture(System.Globalization.CultureInfo culture);

Parameters

culture System.Globalization.CultureInfo

The culture to retrieve localiser for. If not specified, current thread's UI culture is used.

Returns

TLocaliser

LocaliserRegistry<TLocaliser>.ResolveForUiCulture() Method

Gets the localiser for the current thread's UI culture

public TLocaliser ResolveForUiCulture();

Returns

TLocaliser