SharedLocalizationAttribute class
namespace: Serenity.Data assembly: Serenity.Net.Services
Keeps the translations of the row in the shared loc_DataTranslations table of its database, see DataTranslationTable, instead of a localization table of its own like LocalizationRowAttribute. The fields to translate are the string table fields with a [Localizable(true)] attribute. The row must have an ID of type Int16, Int32, Int64, Guid or String.
[AttributeUsage(AttributeTargets.Class)]
public class SharedLocalizationAttribute : Attribute
Public Members
| name | description |
|---|---|
| SharedLocalizationAttribute() | The default constructor. |
| LocalizeListByDefault { get; set; } | If set to true, the list handler (available in Pro.Extensions package) returns the translated values in the language of the user when ListRequest.Localize is not set, also in the fields of other rows whose [Origin] is a localizable field of this row. ListRequest.Localize must then be an empty string to get the original values. The lookup script of the row is translated too, once for each language. Leave it false when code finds the records by their text, e.g. a lookup item by its name. |
Remarks
The table is created by the DataTranslationsMigration of Serenity.Extensions in each database that has such rows. The list handler returns the translations when the request asks for them (ListRequest.Localize, available with Pro.Extensions), also in the fields of other rows whose [Origin] is a localizable field of this row.
See Also
- Source: SharedLocalizationAttribute.cs