Class Localizer
OptimaJet.Workflow.Core.Utils.Localizer
Helper for work with localization.
Namespace: OptimaJet.Workflow.Core.Utils
public class LocalizerInheritance
- System.Object
Constructors
public Localizer(WorkflowRuntime runtime) #Parameters
Name
Type
Description
runtimeWorkflowRuntimepublic Localizer(params ILocalizationProvider[] sources) #Parameters
Name
Type
Description
sourcesILocalizationProvider[]Properties
Name
Type
this[string, LocalizeType, CultureInfo?] #StringGet the localized name in specific culture from bound sources.
Methods
public string GetLocalizedName(string name, LocalizeType type, CultureInfo? culture = null) #Get the localized name in specific culture from bound sources.
Parameters
Name
Type
Description
typeLocalizeTypeLocalize type of name
Returns
Type
Description
StringLocalized name if exists, else input
namepublic Translation? GetTranslation(string name, LocalizeType type, CultureInfo? culture = null) #Get the localize in specific culture from bound sources.
Parameters
Name
Type
Description
typeLocalizeTypeLocalize type of name
Returns
Type
Description
TranslationReturn one of: first non default localize; default first value of localization; null
public Localizer FromScheme(string schemeCode, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
LocalizerNew localizer with expanded source for search a localized name
public Localizer FromScheme(string schemeCode, string? tenantId, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
tenantIdStringTenant identifier
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
LocalizerNew localizer with expanded source for search a localized name
public Localizer FromScheme(Guid schemeId, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeIdGuidId of the scheme
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
LocalizerNew localizer with expanded source for search a localized name
public Localizer FromProcess(Guid processId, bool isAppend = false) #Bind process for getting to inner scheme localization source.
Parameters
Name
Type
Description
processIdGuidId of the process instance
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
LocalizerNew localizer with expanded source for search a localized name
public Localizer FromRuntime(WorkflowRuntime runtime, bool isAppend = false) #Bind process for getting to inner scheme localization source.
Parameters
Name
Type
Description
runtimeWorkflowRuntimeWorkflow runtime instance
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
LocalizerNew localizer with expanded source for search a localized name
public Task<Localizer> FromSchemeAsync(string schemeCode, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
Task<Localizer>New localizer with expanded source for search a localized name
public Task<Localizer> FromSchemeAsync(string schemeCode, string? tenantId, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeCodeStringCode of the scheme
tenantIdStringTenant identifier
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
Task<Localizer>New localizer with expanded source for search a localized name
public Task<Localizer> FromSchemeAsync(Guid schemeId, bool isAppend = false) #Bind scheme for getting to inner scheme localization source.
Parameters
Name
Type
Description
schemeIdGuidisAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
Task<Localizer>New localizer with expanded source for search a localized name
public Task<Localizer> FromProcessAsync(Guid processId, bool isAppend = false) #Bind process for getting to inner scheme localization source.
Parameters
Name
Type
Description
processIdGuidId of the process instance
isAppendBooleanAppends a value to the end of the sequence
Returns
Type
Description
Task<Localizer>New localizer with expanded source for search a localized name