public static void UpdateState(this StandardI18NServiceCollection services) { services.AddPostRegisterAction("FlagState", s => { StaticFlag.HasInit = true; StaticFlag.ExpectedServiceName = "HostImpl"; }); }
/// <summary> /// Add Cosmos.I18N /// </summary> /// <param name="services"></param> /// <param name="serviceAct"></param> /// <returns></returns> /// <exception cref="ArgumentNullException"></exception> public static IServiceCollection AddCosmosLocalization(this IServiceCollection services, Action <II18NServiceCollection> serviceAct) { if (services is null) { throw new ArgumentNullException(nameof(services)); } var serviceImpl = new StandardI18NServiceCollection(services); serviceAct?.Invoke(serviceImpl); serviceImpl.RegisterTranslationManager(); serviceImpl.RegisterLanguageServiceProviders(); serviceImpl.RegisterTranslationProcessor(); return(services); }