Skip to content

LocalizationSerializationMode

Namespace: Bogoware.Localization.Serialization

Controls which properties are localized during JSON serialization.

public enum LocalizationSerializationMode

Inheritance ObjectValueTypeEnumLocalizationSerializationMode
Implements IComparable, ISpanFormattable, IFormattable, IConvertible

Fields

NameValueDescription
Explicit0Localizes only properties explicitly marked with LocalizeAttribute. All other properties are serialized using their default JSON representation. This is the most performant mode and gives full control over which properties are localized.
Auto1Localizes all ILocalizable properties automatically, plus any properties explicitly marked with LocalizeAttribute. Properties marked with DoNotLocalizeAttribute are excluded. This is the default mode, balancing convenience and performance.
Exhaustive2Attempts to localize every property via ILocalizationFormatter.Format(ILocalizable, CultureInfo). Falls back to ToString() for types without a registered provider. Properties marked with DoNotLocalizeAttribute are excluded.