Table of Contents

Class BobLocalizationBundleSpec

Namespace
BlazOrbit.Localization
Assembly
BlazOrbit.Core.dll

Immutable specification of a registered localization bundle. Built either by hand for runtime-only scenarios or - typically - by the source generator and supplied to RegisterBundle(BobLocalizationBundleSpec) from a [ModuleInitializer]-marked method inside the bundle's owning assembly.

public sealed record BobLocalizationBundleSpec
Inheritance
object
BobLocalizationBundleSpec

Constructors

BobLocalizationBundleSpec(Type, string, IReadOnlyList<Type>, IReadOnlyList<BobLocalizationKeyRoute>, FrozenDictionary<string, FrozenDictionary<ulong, string>>?, FrozenDictionary<ulong, string>?)

Immutable specification of a registered localization bundle. Built either by hand for runtime-only scenarios or - typically - by the source generator and supplied to RegisterBundle(BobLocalizationBundleSpec) from a [ModuleInitializer]-marked method inside the bundle's owning assembly.

public BobLocalizationBundleSpec(Type ResourceType, string DefaultCulture, IReadOnlyList<Type> Chain, IReadOnlyList<BobLocalizationKeyRoute> KeyRoutes, FrozenDictionary<string, FrozenDictionary<ulong, string>>? Translations, FrozenDictionary<ulong, string>? SourceLiterals)

Parameters

ResourceType Type

Marker type used by IStringLocalizer<TResource>.

DefaultCulture string

Culture of the source literals in code (terminal fallback).

Chain IReadOnlyList<Type>

Ordered provider types iterated by BobLocalizer<T>.

KeyRoutes IReadOnlyList<BobLocalizationKeyRoute>

Optional prefix routes; when a key matches, the listed provider is consulted before Chain.

Translations FrozenDictionary<string, FrozenDictionary<ulong, string>>

Per-culture hash → translation tables baked at compile time. Read by the built-in BundleProvider. null when no .tn files were supplied - the bundle still works, but every lookup falls through to the source literal.

SourceLiterals FrozenDictionary<ulong, string>

Aggregated hash → source literal table used for diagnostics and the dynamic-key slow path. Generator emits this from every Loc[literal] call site found in the assembly.

Properties

Chain

Ordered provider types iterated by BobLocalizer<T>.

public IReadOnlyList<Type> Chain { get; init; }

Property Value

IReadOnlyList<Type>

DefaultCulture

Culture of the source literals in code (terminal fallback).

public string DefaultCulture { get; init; }

Property Value

string

KeyRoutes

Optional prefix routes; when a key matches, the listed provider is consulted before Chain.

public IReadOnlyList<BobLocalizationKeyRoute> KeyRoutes { get; init; }

Property Value

IReadOnlyList<BobLocalizationKeyRoute>

ResourceType

Marker type used by IStringLocalizer<TResource>.

public Type ResourceType { get; init; }

Property Value

Type

SourceLiterals

Aggregated hash → source literal table used for diagnostics and the dynamic-key slow path. Generator emits this from every Loc[literal] call site found in the assembly.

public FrozenDictionary<ulong, string>? SourceLiterals { get; init; }

Property Value

FrozenDictionary<ulong, string>

Translations

Per-culture hash → translation tables baked at compile time. Read by the built-in BundleProvider. null when no .tn files were supplied - the bundle still works, but every lookup falls through to the source literal.

public FrozenDictionary<string, FrozenDictionary<ulong, string>>? Translations { get; init; }

Property Value

FrozenDictionary<string, FrozenDictionary<ulong, string>>