Skip to content

LocalizationRowTranslations.Apply<TRow> method

Replaces the localizable fields of the rows 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 Apply<TRow>(IDbConnection connection, IEnumerable<TRow> rows, 
    IEnumerable<string> languages, IEnumerable<Field>? fields = null)
    where TRow : class, IRow, new()
parameter description
TRow The row type, which must have a LocalizationRowAttribute.
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 fields to translate, e.g. the ones the rows were loaded with, or null for all the fields that the localization row has. A field that was not loaded would get a value otherwise.

See Also