Skip to content

Game.UI.Localization.ILocElement

Assembly: Game
Namespace: Game.UI.Localization

Type: interface

Base: IJsonWritable

Summary:
Marker/interface contract for UI localization elements used in the game's localization system. ILocElement itself does not declare members; it indicates that an object is a localization element and must support JSON writing via the IJsonWritable contract (from Colossal.UI.Binding). Implementations are intended to be serialized to/from JSON for localization data, editor tools, or runtime UI localization pipelines in mods for Cities: Skylines 2.


Fields

  • (none)
    This interface declares no fields. Any storage is defined by concrete implementations.

Properties

  • (none declared here)
    Properties required for localization objects are provided by concrete types that implement ILocElement and/or by the IJsonWritable interface.

Constructors

  • (interfaces have no constructors)
    Constructors are provided by concrete classes that implement this interface.

Methods

  • (no members declared directly)
    ILocElement itself does not define methods. Implementing types must satisfy the IJsonWritable API (methods/properties for JSON serialization) from Colossal.UI.Binding. Use those members to control how the localization element is written to/read from JSON.

Usage Example

using Colossal.UI.Binding;
using Game.UI.Localization;

// Example implementation sketch — replace IJsonWritable member names with the actual API.
public class LocalizedTextElement : ILocElement
{
    public string Key { get; set; }
    public string DefaultValue { get; set; }

    // IJsonWritable requires implementing the JSON serialization API.
    // The actual method names/signatures come from Colossal.UI.Binding.IJsonWritable.
    // Below is a placeholder to show intent.
    public void WriteJson(/*JsonWriter writer or appropriate params*/)
    {
        // write Key and DefaultValue to JSON using the real IJsonWritable contract
    }

    public void ReadJson(/*JsonReader reader or appropriate params*/)
    {
        // read Key and DefaultValue from JSON using the real IJsonWritable contract
    }
}

Notes: - ILocElement is primarily a marker for localization-related UI elements; check the Colossal.UI.Binding.IJsonWritable interface for exact serialization members to implement. - Use this interface for types that must participate in the game's localization serialization/deserialization workflows (mod tools, import/export, runtime UI localization).