// This method gets called by the runtime. Use this method to add services to the container. // For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940 public void ConfigureServices(IServiceCollection services) { Translater.AddLanguageFile(new Translater.SourceItem[] { new Translater.SourceItem() { CultureName = "cn", ItemType = Translater.SourceItemType.OrignalString, Data = DevelopmentCode.Properties.Resources.cn }, new Translater.SourceItem() { CultureName = "en", ItemType = Translater.SourceItemType.OrignalString, Data = DevelopmentCode.Properties.Resources.en }, }); Translater.ConvertTo("en"); services.AddRazorPages(); services.AddServerSideBlazor(); services.AddLuanNiaoBlazorAntdExtensions(); }
public static async Task Main(string[] args) { var builder = WebAssemblyHostBuilder.CreateDefault(args); builder.RootComponents.Add <App>("app"); Translater.AddLanguageFile(new Translater.SourceItem[] { new Translater.SourceItem() { CultureName = "cn", ItemType = Translater.SourceItemType.OrignalString, Data = Resources.cn }, new Translater.SourceItem() { CultureName = "en", ItemType = Translater.SourceItemType.OrignalString, Data = Resources.en }, }); Translater.ConvertTo("en"); //builder.Services.AddSingleton(new HttpClient { BaseAddress = new Uri(builder.HostEnvironment.BaseAddress) }); builder.Services.AddLuanNiaoBlazorAntdExtensions(); await builder.Build().RunAsync(); }