Skip to content

DataTranslationStore.ApplyTranslations<TRow> method

Replaces the localizable fields of rows that were loaded without the list handler, e.g. with connection.List in a custom service, with their translations in the first of the languages that has one, with one query for all the rows. A field without a translation keeps its value.

public static void ApplyTranslations<TRow>(IDbConnection connection, IEnumerable<TRow> rows, 
    IEnumerable<string> languages, IEnumerable<Field>? fields = null)
    where TRow : class, IRow
parameter description
TRow The row type, which must have a SharedLocalizationAttribute.
connection The connection to the database of the row.
rows The rows, which must have their ID.
languages The languages in the order they are looked up, see DataTranslationLanguages.
fields The localizable fields to translate, e.g. the ones the rows were loaded with, or null for all of them. A field that was not loaded would get a value otherwise.

See Also