Table of Contents

Namespace Tlumach.Extensions.Localization

Classes

TlumachLocalizationExtensions

Adds the classes necessary for dependency injection.

TlumachLocalizationOptions

The options that tell the localizers where to take the translations from: an existing TranslationManager, a TranslationConfiguration, or a default translation file embedded into an assembly.

The default options are set in the callback passed to AddTlumachLocalization(IServiceCollection, Action<TlumachLocalizationOptions>, Action<TlumachSettingsProvider>?), and the options of a context are returned by GetOptionsFor(string).

TlumachSettingsProvider

This class keeps settings for various localizer instances bound to specific contents.

The methods of this class can be called from several threads at once, so contexts can be added while the application is running.

TlumachStringLocalizer

The class that provides localization functionality.

TlumachStringLocalizerFactory

Creates instances of TlumachStringLocalizer.

The localizers are created anew on every call (IStringLocalizer<T> is transient), but the translation managers that the factory creates are cached: those created from options by what the options describe (the Configuration instance, or the DefaultFile with its assembly and locale, together with the text processing mode), not by the options instance, and those created for a base name without options by the base name and the assembly (the one that the location names, or the calling one). So the localizers do not load translations again even when the settings provider returns new options objects. The options are still requested for every localizer, so a provider can switch a context to another manager at runtime.

TlumachStringLocalizer<T>

Represents an IStringLocalizer that provides strings for T.

Interfaces

ITlumachSettingsProvider

An interface that defines the GetOptionsFor method of the settings provider.