Skip to content

ILocalizationProvider<T>

Namespace: Bogoware.Localization

External DI provider that can localize instances of . No constraint on T — any type can have an external localization provider.

public interface ILocalizationProvider<T>

Type Parameters

T
The type this provider can localize.

Attributes NullableContextAttribute

Remarks:

Register implementations in the DI container to provide localization for types that do not (or cannot) implement ILocalizationProvider themselves. This is the second step in the resolution chain, after self-providers and before registry template lookup.

Multiple providers can coexist for different types. The formatter resolves the provider for the runtime type of the value being formatted.

Methods

Localize(T, CultureInfo)

Produces a localized string representation of the given value.

string Localize(T value, CultureInfo culture)

Parameters

value T
The instance to localize.

culture CultureInfo
The target culture. When , defaults to CultureInfo.CurrentUICulture at the discretion of the implementor.

Returns

String
A culture-aware human-readable string for value.