Interface ITlumachSettingsProvider
- Namespace
- Tlumach.Extensions.Localization
- Assembly
- Tlumach.Extensions.Localization.dll
An interface that defines the GetOptionsFor method of the settings provider.
public interface ITlumachSettingsProvider
Methods
GetOptionsFor(string)
Returns the options set for the given context.
This method is called every time a localizer is created, which may happen on every request. An implementation may return a new options object on every call,
but it should put the same TranslationManager or Configuration instance into it every time:
the string localizers of TlumachStringLocalizerFactory and the HTML localizers of Tlumach.AspNetCore.Mvc reuse a translation manager created from options while the options carry the same TranslationManager instance, the same
Configuration instance, or the same DefaultFile, Assembly, and DefaultFileLocale values (with the same TextProcessingMode).
A new configuration on every call creates a new translation manager on every call, and every manager stays in TranslationManagers until it is disposed.
TlumachLocalizationOptions GetOptionsFor(string context)
Parameters
contextstringThe context to retrieve the options for.
Returns
- TlumachLocalizationOptions
An instance of options or the default value if the options specific for the context were not found.