Skip to content

LocalizeAttribute

Namespace: Bogoware.Localization.Serialization

Marks a property for localized serialization. When applied, the property value is formatted via ILocalizationFormatter.Format(ILocalizable, CultureInfo) and written as a JSON string instead of its default object structure.

public sealed class LocalizeAttribute : System.Attribute

Inheritance ObjectAttributeLocalizeAttribute
Attributes AttributeUsageAttribute

Remarks:

In LocalizationSerializationMode.Auto mode, ILocalizable properties are localized automatically; use this attribute on non-ILocalizable types that have an ILocalizationProvider<T> registered in DI.

In LocalizationSerializationMode.Explicit mode, only properties with this attribute are localized — all others use their default serialization.

Properties

TypeId

public object TypeId { get; }

Property Value

Object

Constructors

LocalizeAttribute()

public LocalizeAttribute()