Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

A standard property stores a single unit of data; a multi-language property stores one unit of data per data language defined in the Metadata ModelsLanguages.

Usage

Call ClassBuilder.Add.MultiLanguageProperty(...) on a ClassBuilder in a Builder API to add a multi-language property to that class.

...

Code Block
Elements.Person.Add.MultiLanguageProperty("Attachment", MetaType.Binary);

Structure

Adding a multi-language property includes the following properties in the class:

...

The multi-language property itself has a list of Properties that contains the language-specific properties.

Naming

The name of the multi-language property is taken from the parameter passed to the builder method. The names of the language-specific properties are generated using IMetaNameTools.GetName() (for which an application can register its own service). By default, the service appends the name of the language (e.g. "Notes_en").

Storage

The ORM and schema-migration both support multi-language properties. A multi-language property maps to n columns in the database table of its meta-class, one for each data language.

Code-Generation

The Metadata Generated Modell Generieren and generated classes both support multi-language properties.

...

In addition to the getter for the calculated property (e.g. Notes), the generated class includes two methods to provide statically typed access to the language-specific values (e.g. GetNotes(ILanguage language) and SetNotes(ILanguage, string)).

Layouts

Call the LinkMultiLanguage(...) on a LayoutBuilder to add the property to the given layout. Per default this will add:

...