Table of Contents

Class TlumachStringLocalizerFactory

Namespace
Tlumach.Extensions.Localization
Assembly
Tlumach.Extensions.Localization.dll

Creates instances of TlumachStringLocalizer.

public sealed class TlumachStringLocalizerFactory : IStringLocalizerFactory
Inheritance
TlumachStringLocalizerFactory
Implements
Inherited Members

Constructors

TlumachStringLocalizerFactory(ITlumachSettingsProvider)

Initializes a new instance of the TlumachStringLocalizerFactory class using the given configuration provider.

public TlumachStringLocalizerFactory(ITlumachSettingsProvider settingsProvider)

Parameters

settingsProvider ITlumachSettingsProvider

The options to use when creating TlumachStringLocalizer instances.

Methods

Create(string, string)

Creates an instance of TlumachStringLocalizer from the default file, embedded into resources of the assembly that is calling this method.

The created localizer uses CurrentCulture for a culture and DotNet text processing mode for texts with placeholders. An application can change either of these settings later by calling WithCulture(CultureInfo) or WithTextProcessingMode(TextFormat) method respectively.

public IStringLocalizer Create(string baseName, string location)

Parameters

baseName string

The name of the default file.

location string

Not used.

Returns

IStringLocalizer

An instance of TlumachStringLocalizer.

Exceptions

TlumachException

Thrown if the default file provided in baseName was not found.

ArgumentNullException

Thrown if the baseName is null or empty.

Create(Type)

Creates an instance of TlumachStringLocalizer from the options or from the reference to the generated class.

public IStringLocalizer Create(Type resourceSource)

Parameters

resourceSource Type

The type of the class created by Tlumach Generator.

Returns

IStringLocalizer

An instance of TlumachStringLocalizer.

Exceptions

TlumachException

Thrown if the TranslationManager instance cannot be obtained from the class provided in resourceSource.