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
-
objectBobLocalizationBundleSpec
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
ResourceTypeTypeMarker type used by
IStringLocalizer<TResource>.DefaultCulturestringCulture of the source literals in code (terminal fallback).
ChainIReadOnlyList<Type>Ordered provider types iterated by BobLocalizer<T>.
KeyRoutesIReadOnlyList<BobLocalizationKeyRoute>Optional prefix routes; when a key matches, the listed provider is consulted before
Chain.TranslationsFrozenDictionary<string, FrozenDictionary<ulong, string>>Per-culture hash → translation tables baked at compile time. Read by the built-in
BundleProvider. null when no.tnfiles were supplied - the bundle still works, but every lookup falls through to the source literal.SourceLiteralsFrozenDictionary<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>>