Workflow Engine .NET

Assembly: OptimaJet.Workflow.Core

Class Localizer

OptimaJet.Workflow.Core.Utils.Localizer

Helper for work with localization.

public class Localizer

Inheritance

  • System.Object

Constructors

public Localizer(WorkflowRuntime runtime) #

Parameters

Name
Type
Description
runtime
WorkflowRuntime
public Localizer(params ILocalizationProvider[] sources) #

Parameters

Name
Type
Description
sources
ILocalizationProvider[]

Properties

Name
Type
this[string, LocalizeType, CultureInfo?] #
String
Get 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
name
String
System name. See Translation.ObjectName
type
LocalizeType
Localize type of name
culture
CultureInfo
Desired culture. If null then used CultureInfo.CurrentCulture

Returns

Type
Description
String
Localized name if exists, else input name
public Translation? GetTranslation(string name, LocalizeType type, CultureInfo? culture = null) #
Get the localize in specific culture from bound sources.

Parameters

Name
Type
Description
name
String
System name. See Translation.ObjectName
type
LocalizeType
Localize type of name
culture
CultureInfo
Desired culture. If null then used CultureInfo.CurrentCulture

Returns

Type
Description
Translation
Return 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
schemeCode
String
Code of the scheme
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Localizer
New 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
schemeCode
String
Code of the scheme
tenantId
String
Tenant identifier
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Localizer
New 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
schemeId
Guid
Id of the scheme
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Localizer
New 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
processId
Guid
Id of the process instance
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Localizer
New 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
runtime
WorkflowRuntime
Workflow runtime instance
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Localizer
New 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
schemeCode
String
Code of the scheme
isAppend
Boolean
Appends 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
schemeCode
String
Code of the scheme
tenantId
String
Tenant identifier
isAppend
Boolean
Appends 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
schemeId
Guid
isAppend
Boolean
Appends 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
processId
Guid
Id of the process instance
isAppend
Boolean
Appends a value to the end of the sequence

Returns

Type
Description
Task<Localizer>
New localizer with expanded source for search a localized name