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
Syntaxpublic class Localizer
Constructors
Localizer(WorkflowRuntime)
Declarationpublic Localizer(WorkflowRuntime runtime)
Type | Name | Description |
---|---|---|
WorkflowRuntime | runtime |
Localizer(params ILocalizationProvider[])
Declarationpublic Localizer(params ILocalizationProvider[] sources)
Type | Name | Description |
---|---|---|
OptimaJet.Workflow.Core.Runtime.ILocalizationProvider[] | sources |
Properties
this[string, LocalizeType, CultureInfo?]
Get the localized name in specific culture from bound sources.
Declarationpublic string this[string name, LocalizeType type, CultureInfo? culture = null] { get; }
Type | Name | Description |
---|---|---|
string | name | System name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref> |
LocalizeType | type | Localize type of name |
CultureInfo | culture | Desired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref> |
Type | Description |
---|---|
string | Localized 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.
Declarationpublic string GetLocalizedName(string name, LocalizeType type, CultureInfo? culture = null)
Type | Name | Description |
---|---|---|
string | name | System name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref> |
LocalizeType | type | Localize type of name |
CultureInfo | culture | Desired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref> |
Type | Description |
---|---|
string | Localized 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.
Declarationpublic Translation? GetTranslation(string name, LocalizeType type, CultureInfo? culture = null)
Type | Name | Description |
---|---|---|
string | name | System name. See <xref href="OptimaJet.Workflow.Core.Model.Translation.ObjectName" data-throw-if-not-resolved="false"></xref> |
LocalizeType | type | Localize type of name |
CultureInfo | culture | Desired culture. If null then used <xref href="System.Globalization.CultureInfo.CurrentCulture" data-throw-if-not-resolved="false"></xref> |
Type | Description |
---|---|
Translation | Return one of: first non default localize; default first value of localization; null |
FromScheme(string, bool)
Bind scheme for getting to inner scheme localization source.
Declarationpublic Localizer FromScheme(string schemeCode, bool isAppend = false)
Type | Name | Description |
---|---|---|
string | schemeCode | Code of the scheme |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Localizer | New localizer with expanded source for search a localized name |
FromScheme(Guid, bool)
Bind scheme for getting to inner scheme localization source.
Declarationpublic Localizer FromScheme(Guid schemeId, bool isAppend = false)
Type | Name | Description |
---|---|---|
Guid | schemeId | Id of the scheme |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Localizer | New localizer with expanded source for search a localized name |
FromProcess(Guid, bool)
Bind process for getting to inner scheme localization source.
Declarationpublic Localizer FromProcess(Guid processId, bool isAppend = false)
Type | Name | Description |
---|---|---|
Guid | processId | Id of the process instance |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Localizer | New localizer with expanded source for search a localized name |
FromRuntime(WorkflowRuntime, bool)
Bind process for getting to inner scheme localization source.
Declarationpublic Localizer FromRuntime(WorkflowRuntime runtime, bool isAppend = false)
Type | Name | Description |
---|---|---|
WorkflowRuntime | runtime | Workflow runtime instance |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Localizer | New localizer with expanded source for search a localized name |
FromSchemeAsync(string, bool)
Bind scheme for getting to inner scheme localization source.
Declarationpublic Task<Localizer> FromSchemeAsync(string schemeCode, bool isAppend = false)
Type | Name | Description |
---|---|---|
string | schemeCode | Code of the scheme |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Task<Localizer> | New localizer with expanded source for search a localized name |
FromSchemeAsync(Guid, bool)
Bind scheme for getting to inner scheme localization source.
Declarationpublic Task<Localizer> FromSchemeAsync(Guid schemeId, bool isAppend = false)
Type | Name | Description |
---|---|---|
Guid | schemeId | |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Task<Localizer> | New localizer with expanded source for search a localized name |
FromProcessAsync(Guid, bool)
Bind process for getting to inner scheme localization source.
Declarationpublic Task<Localizer> FromProcessAsync(Guid processId, bool isAppend = false)
Type | Name | Description |
---|---|---|
Guid | processId | Id of the process instance |
bool | isAppend | Appends a value to the end of the sequence |
Type | Description |
---|---|
Task<Localizer> | New localizer with expanded source for search a localized name |