Class ServiceCollectionExtensions
- Namespace
- BlazOrbit.Localization
- Assembly
- BlazOrbit.Core.dll
DI registration for the BOBLocalize runtime. The single entry point - AddBlazOrbitLocalization(IServiceCollection, Action<BobLocalizationOptions>?) - wires the Microsoft.Extensions.Localization.IStringLocalizer<T> resolution to BobLocalizer<T> and registers the built-in providers.
public static class ServiceCollectionExtensions
- Inheritance
-
objectServiceCollectionExtensions
Methods
AddBlazOrbitLocalization(IServiceCollection, Action<BobLocalizationOptions>?)
Registers the BOBLocalize runtime. Built-in providers (LiteralProvider, BundleProvider) are added as singletons; the Microsoft.Extensions.Localization.IStringLocalizer<T> open generic is reassigned to BobLocalizer<T>. Custom providers register via the returned IBobLocalizationBuilder.
public static IBobLocalizationBuilder AddBlazOrbitLocalization(this IServiceCollection services, Action<BobLocalizationOptions>? configure = null)
Parameters
servicesIServiceCollectionconfigureAction<BobLocalizationOptions>
Returns
Remarks
Safe to call multiple times - duplicate registrations are idempotent (TryAdd
variants). The actual bundle data comes from each owning assembly's
[ModuleInitializer] emitted by the source generator and registered through
RegisterBundle(BobLocalizationBundleSpec) before any consumer runs.