Search Results for

    Show / Hide Table of Contents

    Class NameLocalizer

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

    Inheritance
    System.Object
    NameLocalizer
    DefaultLocalizationManager
    Inherited Members
    System.Object.ToString()
    System.Object.Equals(System.Object)
    System.Object.Equals(System.Object, System.Object)
    System.Object.ReferenceEquals(System.Object, System.Object)
    System.Object.GetHashCode()
    System.Object.GetType()
    System.Object.MemberwiseClone()
    Namespace: TimeCockpit.Data.Localization
    Assembly: TimeCockpit.Data.dll
    Syntax
    public class NameLocalizer

    Constructors

    NameLocalizer()

    Initializes a new instance of the NameLocalizer class.

    Declaration
    public NameLocalizer()

    Properties

    Resources

    Gets or sets the localization resources.

    Declaration
    public Resources Resources { get; set; }
    Property Value
    Type Description
    Resources

    Methods

    GetLocalizedBackReferenceFriendlyName(Relation, CultureInfo)

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

    Declaration
    public virtual string GetLocalizedBackReferenceFriendlyName(Relation elementToTranslate, CultureInfo targetCulture)
    Parameters
    Type Name Description
    Relation elementToTranslate

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

    System.Globalization.CultureInfo targetCulture

    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
    Type Description
    System.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.

    Declaration
    public virtual string GetLocalizedFriendlyName(ModelElement elementToTranslate, CultureInfo targetCulture)
    Parameters
    Type Name Description
    ModelElement elementToTranslate

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

    System.Globalization.CultureInfo targetCulture

    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
    Type Description
    System.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.

    Declaration
    public virtual string GetLocalizedMemberNullMessage(ModelElement member = null, ModelEntityBase entity = null)
    Parameters
    Type Name Description
    ModelElement member

    Member model element (relation, property).

    ModelEntityBase entity

    Model entity.

    Returns
    Type Description
    System.String

    Localized message.

    GetLocalizedMessage(ValidationRule, CultureInfo)

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

    Declaration
    public virtual string GetLocalizedMessage(ValidationRule elementToTranslate, CultureInfo targetCulture)
    Parameters
    Type Name Description
    ValidationRule elementToTranslate

    ValidationRule for which the message has to be translated.

    System.Globalization.CultureInfo targetCulture

    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
    Type Description
    System.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.

    Declaration
    public virtual string GetLocalizedMessage(Permission elementToTranslate, CultureInfo targetCulture)
    Parameters
    Type Name Description
    Permission elementToTranslate

    Permission for which the message has to be translated.

    System.Globalization.CultureInfo targetCulture

    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
    Type Description
    System.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.

    Declaration
    public virtual string GetLocalizedText(string textConstantIdentifier, CultureInfo targetCulture, string defaultText = null)
    Parameters
    Type Name Description
    System.String textConstantIdentifier

    Identifier of the text constant that has to be translated.

    System.Globalization.CultureInfo targetCulture

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

    System.String defaultText

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

    Returns
    Type Description
    System.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.

    Declaration
    public virtual void PrepareLocalizations(IDataContext dataContext)
    Parameters
    Type Name Description
    IDataContext dataContext

    the data context to query for culture information.

    PrepareLocalizationsAsync(IDataContext)

    called to update the localizer in silverlight.

    Declaration
    public virtual Task PrepareLocalizationsAsync(IDataContext dataContext)
    Parameters
    Type Name Description
    IDataContext dataContext

    The datacontext to use for updating.

    Returns
    Type Description
    System.Threading.Tasks.Task

    Returns an observable notifying when done.

    In This Article
    Back to top Copyright © 2020 software architects gmbh