Assembly: OptimaJet.Workflow.Core

Class Translation

OptimaJet.Workflow.Core.Model.Translation

Represents a translation entry that maps a scheme object's internal name and LocalizeType to culture-specific text.

public sealed class Translation

Constructors

public Translation() #
Initializes a new translation entry with default property values.
public Translation(string name, string value, LocalizeType type, string culture, bool isDefault = false) #
Initializes a translation entry for a scheme object.

Parameters

Name
Type
Description
name
String
The internal name to assign to Translation.ObjectName.
value
String
The culture-specific text to assign to Translation.Value.
type
LocalizeType
The LocalizeType to assign to Translation.Type.
culture
String
The culture name to assign to Translation.Culture.
isDefault
Boolean
The value to assign to Translation.IsDefault. Use true to make the entry a fallback when no culture-specific entry matches.

Properties

public string ObjectName { get; set; } #
Gets or sets the internal name of the scheme object being translated.
public string Value { get; set; } #
Gets or sets the culture-specific text for the scheme object.
[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter<LocalizeType>))] public LocalizeType Type { get; set; } #
Gets or sets the LocalizeType that identifies the kind of scheme object.
public string Culture { get; set; } #
Gets or sets the culture name used for this translation entry.
public bool IsDefault { get; set; } #
Gets or sets a value indicating whether this entry is the fallback when no entry matches the requested culture.

Methods

public static Translation Create(string name, string type, string culture, string value, string isDefault) #
Creates a Translation by parsing type and isDefault.

Parameters

Name
Type
Description
name
String
The internal name to assign to Translation.ObjectName.
type
String
The case-insensitive name of the LocalizeType value to assign to Translation.Type.
culture
String
The culture name to assign to Translation.Culture.
value
String
The culture-specific text to assign to Translation.Value.
isDefault
String
A string indicating whether Translation.IsDefault should be true.

Returns

Type
Description
Translation
A Translation initialized from the supplied values.

Remarks

If type cannot be parsed, LocalizeType.Command is used. If isDefault cannot be parsed, false is used.
public static Translation Create(string name, LocalizeType type, string culture, string value, bool isDefault = false) #
Creates a Translation for the culture named by culture.

Parameters

Name
Type
Description
name
String
The internal name to assign to Translation.ObjectName.
type
LocalizeType
The LocalizeType to assign to Translation.Type.
culture
String
The culture name to assign to Translation.Culture.
value
String
The culture-specific text to assign to Translation.Value.
isDefault
Boolean
The value to assign to Translation.IsDefault. Use true to make the entry a fallback when no culture-specific entry matches.

Returns

Type
Description
Translation
A Translation initialized from the supplied values.
public static Translation Create(string name, LocalizeType type, CultureInfo culture, string value, bool isDefault = false) #
Creates a Translation for culture.

Parameters

Name
Type
Description
name
String
The internal name to assign to Translation.ObjectName.
type
LocalizeType
The LocalizeType to assign to Translation.Type.
culture
CultureInfo
The culture whose CultureInfo.Name is assigned to Translation.Culture.
value
String
The culture-specific text to assign to Translation.Value.
isDefault
Boolean
The value to assign to Translation.IsDefault. Use true to make the entry a fallback when no culture-specific entry matches.

Returns

Type
Description
Translation
A Translation initialized from the supplied values.
public Translation Clone() #
Creates a shallow copy of this translation entry.

Returns

Type
Description
Translation
A shallow copy of this Translation.