Skip to main content

Introducing Formengine - The New Formbuilder, try for FREE formengine.io.

Class Localizer

Helper for work with localization.

Inheritance

↳ object

    Localizer

Inherited Members

Equals(object)

Equals(object, object)

GetHashCode()

GetType()

MemberwiseClone()

ReferenceEquals(object, object)

ToString()

Namespace: OptimaJet.Workflow.Core.Utils

Assembly: OptimaJet.Workflow.Core.dll

Syntax
public class Localizer

Constructors

Localizer(WorkflowRuntime)

Declaration
public Localizer(WorkflowRuntime runtime)
Parameters
TypeNameDescription
WorkflowRuntimeruntime

Localizer(params ILocalizationProvider[])

Declaration
public Localizer(params ILocalizationProvider[] sources)
Parameters
TypeNameDescription
OptimaJet.Workflow.Core.Runtime.ILocalizationProvider[]sources

Properties

this[string, LocalizeType, CultureInfo?]

Get the localized name in specific culture from bound sources.

Declaration
public string this[string name, LocalizeType type, CultureInfo? culture = null] { get; }
Parameters
TypeNameDescription
stringnameSystem name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref>
LocalizeTypetypeLocalize type of name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Property value
TypeDescription
stringLocalized name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

Methods

GetLocalizedName(string, LocalizeType, CultureInfo?)

Get the localized name in specific culture from bound sources.

Declaration
public string GetLocalizedName(string name, LocalizeType type, CultureInfo? culture = null)
Parameters
TypeNameDescription
stringnameSystem name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref>
LocalizeTypetypeLocalize type of name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
stringLocalized name if exists, else input <code data-dev-comment-type="paramref" class="paramref">name</code>

GetTranslation(string, LocalizeType, CultureInfo?)

Get the localize in specific culture from bound sources.

Declaration
public Translation? GetTranslation(string name, LocalizeType type, CultureInfo? culture = null)
Parameters
TypeNameDescription
stringnameSystem name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref>
LocalizeTypetypeLocalize type of name
CultureInfocultureDesired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref>
Returns
TypeDescription
TranslationReturn one of: first non default localize; default first value of localization; null

FromScheme(string, bool)

Bind scheme for getting to inner scheme localization source.

Declaration
public Localizer FromScheme(string schemeCode, bool isAppend = false)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
LocalizerNew localizer with expanded source for search a localized name

FromScheme(Guid, bool)

Bind scheme for getting to inner scheme localization source.

Declaration
public Localizer FromScheme(Guid schemeId, bool isAppend = false)
Parameters
TypeNameDescription
GuidschemeIdId of the scheme
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
LocalizerNew localizer with expanded source for search a localized name

FromProcess(Guid, bool)

Bind process for getting to inner scheme localization source.

Declaration
public Localizer FromProcess(Guid processId, bool isAppend = false)
Parameters
TypeNameDescription
GuidprocessIdId of the process instance
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
LocalizerNew localizer with expanded source for search a localized name

FromRuntime(WorkflowRuntime, bool)

Bind process for getting to inner scheme localization source.

Declaration
public Localizer FromRuntime(WorkflowRuntime runtime, bool isAppend = false)
Parameters
TypeNameDescription
WorkflowRuntimeruntimeWorkflow runtime instance
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
LocalizerNew localizer with expanded source for search a localized name

FromSchemeAsync(string, bool)

Bind scheme for getting to inner scheme localization source.

Declaration
public Task<Localizer> FromSchemeAsync(string schemeCode, bool isAppend = false)
Parameters
TypeNameDescription
stringschemeCodeCode of the scheme
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
Task<Localizer>New localizer with expanded source for search a localized name

FromSchemeAsync(Guid, bool)

Bind scheme for getting to inner scheme localization source.

Declaration
public Task<Localizer> FromSchemeAsync(Guid schemeId, bool isAppend = false)
Parameters
TypeNameDescription
GuidschemeId
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
Task<Localizer>New localizer with expanded source for search a localized name

FromProcessAsync(Guid, bool)

Bind process for getting to inner scheme localization source.

Declaration
public Task<Localizer> FromProcessAsync(Guid processId, bool isAppend = false)
Parameters
TypeNameDescription
GuidprocessIdId of the process instance
boolisAppendAppends a value to the end of the sequence
Returns
TypeDescription
Task<Localizer>New localizer with expanded source for search a localized name

Extension Methods