Table of Contents

Class NameLocalizer

Namespace
TimeCockpit.Data.Localization
Assembly
TimeCockpit.Data.dll

A calls providing methods for the translation process of the Model.

public class NameLocalizer
Inheritance
Object
NameLocalizer
Derived
Inherited Members
Object.ToString()
Object.Equals(Object)
Object.Equals(Object, Object)
Object.ReferenceEquals(Object, Object)
Object.GetHashCode()
Object.GetType()
Object.MemberwiseClone()

Constructors

NameLocalizer()

Initializes a new instance of the NameLocalizer class.

public NameLocalizer()

Properties

Resources

Gets or sets the localization resources.

public Resources Resources { get; set; }

Property Value

Resources

Methods

GetLocalizedBackReferenceFriendlyName(Relation, CultureInfo)

Returns the localized back reference friendly name for the specified model element.

public virtual string GetLocalizedBackReferenceFriendlyName(Relation elementToTranslate, CultureInfo targetCulture)

Parameters

elementToTranslate Relation

Model entity for which a property has to be translated. It has to be a type derived from ModelElement.

targetCulture CultureInfo

Target culture for which the implementer has to provide a localized name. The CoFX UI will pass the current UI culture into this parameter.

Returns

String

Localized text that CoFX has to use. A return value of null indicates that the back reference name has no translation. In this case CoFX will use the BackReferenceInvariantFriendlyName of the Relation.

GetLocalizedFriendlyName(ModelElement, CultureInfo)

Returns the localized friendly name for the specified model element.

public virtual string GetLocalizedFriendlyName(ModelElement elementToTranslate, CultureInfo targetCulture)

Parameters

elementToTranslate ModelElement

Model entity for which a property has to be translated. It has to be a type derived from ModelElement.

targetCulture CultureInfo

Target culture for which the implementer has to provide a localized name. The CoFX UI will pass the current UI culture into this parameter.

Returns

String

Localized text that CoFX has to use. A return value of null indicates that the name has no translation. In this case CoFX will use the InvariantFriendlyName of the model element repectively the Message of the validation rule.

GetLocalizedMemberNullMessage(ModelElement, ModelEntityBase)

Returns the localized message for members (relation, property) that are not nullable but are currently/setting null.

public virtual string GetLocalizedMemberNullMessage(ModelElement member = null, ModelEntityBase entity = null)

Parameters

member ModelElement

Member model element (relation, property).

entity ModelEntityBase

Model entity.

Returns

String

Localized message.

GetLocalizedMessage(ValidationRule, CultureInfo)

Returns the localized validation rule message for the specified validation rule.

public virtual string GetLocalizedMessage(ValidationRule elementToTranslate, CultureInfo targetCulture)

Parameters

elementToTranslate ValidationRule

ValidationRule for which the message has to be translated.

targetCulture CultureInfo

Target culture for which the implementer has to provide a localized name. The CoFX UI will pass the current UI culture into this parameter.

Returns

String

Localized text that CoFX has to use. A return value of null indicates that the message has no translation. In this case CoFX will use the Message of the ValidationRule.

GetLocalizedMessage(Permission, CultureInfo)

Returns the localized permission message for the specified permissions.

public virtual string GetLocalizedMessage(Permission elementToTranslate, CultureInfo targetCulture)

Parameters

elementToTranslate Permission

Permission for which the message has to be translated.

targetCulture CultureInfo

Target culture for which the implementer has to provide a localized name. The CoFX UI will pass the current UI culture into this parameter.

Returns

String

Localized text that CoFX has to use. A return value of null indicates that the message has no translation. In this case CoFX will use the Message of the Permission.

GetLocalizedText(String, CultureInfo, String)

Returns the localized text for the specified text constant.

public virtual string GetLocalizedText(string textConstantIdentifier, CultureInfo targetCulture, string defaultText = null)

Parameters

textConstantIdentifier String

Identifier of the text constant that has to be translated.

targetCulture CultureInfo

Target culture for which the implementer has to provide a localized name. The CoFX UI will pass the current UI culture into this parameter.

defaultText String

A default text if the lookup of the identifier did not return a result.

Returns

String

Localized text that CoFX has to use. A return value of null indicates that no translation was found for the text constant identfier.

PrepareLocalizations(IDataContext)

prepares the localizer to serve localizations specified.

public virtual void PrepareLocalizations(IDataContext dataContext)

Parameters

dataContext IDataContext

the data context to query for culture information.

PrepareLocalizationsAsync(IDataContext)

called to update the localizer in silverlight.

public virtual Task PrepareLocalizationsAsync(IDataContext dataContext)

Parameters

dataContext IDataContext

The datacontext to use for updating.

Returns

Task

Returns an observable notifying when done.