/
Captions

Captions

Captions sind für den User gedachte Beschriftungen für verschiedene Sprachen. Sie werden in Objekten vom Typ DynamicString gespeichert.

Set a single value

Elements.Company .Caption("de-CH", "Firma") .Caption("fr-CH", "firme");

This is the recommended way to set captions.

Defining values for code elements

Quino includes support for decorating code elements (e.g. enums) with language-specific captions and for reading those captions at run-time.

The LanguageTextAttribute associates a string value with a language. Quino defines EnglishCaptionAttribute and GermanCaptionAttribute for convenience. Applications are free to define their own.

The example below shows how to use the attributes.

public static class StandardRights { [GermanCaption("Lesen")] [EnglishCaption("Read")] public const string Read = "read"; }

Defining expressions for captions

If the caption depends on some other property an expression can be assigned to it. This currently only works for standard use-cases. It does not work in the following cases:

  • MultiLanguageProperty

  • List-Layouts

  • PluralCaption of a class

Elements.Company .CaptionExpression("de-CH", "Active ? 'Aktive Person' : 'Inaktiv'");

 

Related content

Multi-Language Properties
Multi-Language Properties
More like this
Actions
Read with this
Übersetzungen ECUI Client
Übersetzungen ECUI Client
More like this
Checkliste Modellierung
Checkliste Modellierung
Read with this
Übersetzungen
Übersetzungen
More like this
Builder API Architecture and Usage
Builder API Architecture and Usage
Read with this