HangfireIO / Hangfire

An easy way to perform background job processing in .NET and .NET Core applications. No Windows Service or separate process required
https://www.hangfire.io
Other
9.44k stars 1.71k forks source link

NETCORE 8+hangfire 1.8.5 can't set correct dashboard language #2327

Open zdw2018 opened 11 months ago

zdw2018 commented 11 months ago

I tried to use it in .NETCORE 8+hangfire 1.8.5 but it still shows English even though I set Chinese in start up. I even added culture=zh-CN to the request header, but it still doesn't work. image My configuration is as follows:

services.AddHangfire(configuration => configuration
.SetDataCompatibilityLevel(CompatibilityLevel.Version_180)
.UseSimpleAssemblyNameTypeSerializer()
.UseRecommendedSerializerSettings()
       .UseInMemoryStorage());

services.AddHangfireServer();

   var supportedCultures = new string[] { "zh-CN" };
    app.UseRequestLocalization(options =>
                options
                .AddSupportedCultures(supportedCultures)
                .AddSupportedUICultures(supportedCultures)
                .SetDefaultCulture("zh-CN")
                .RequestCultureProviders.Insert(0, new CustomRequestCultureProvider(context =>
                {
                    return Task.FromResult(new ProviderCultureResult("zh-CN"));
                }))
        ); app.UseHangfireDashboard("/job");
dorathoto commented 11 months ago

look here: https://github.com/HangfireIO/Hangfire/issues/881