HangfireIO/Hangfire

Wrong dashboard langauge culture

オープン

#881 opened on 2017/05/13

 (9 件のコメント) (0 件のリアクション) (0 人の担当者)C# (1,748 件のフォーク)batch import
help wantedt: question

Repository metrics

Stars
 (10,068 個のスター)
PR merge metrics
 (30d に merged PR はありません)

説明

My project has configured to support few languages but the dashboard is still showing wrong language culture.


var supportedCultures = new[]
{
    new CultureInfo("en-US"),
    new CultureInfo("en-AU"),
    new CultureInfo("en-GB")
};

app.UseRequestLocalization(new RequestLocalizationOptions
{
    DefaultRequestCulture = new RequestCulture("en-US"),
    // Formatting numbers, dates, etc.
    SupportedCultures = supportedCultures,
    // UI strings that we have localized.
    SupportedUICultures = supportedCultures
});
            
app.UseStaticFiles();

app.UseMvc(routes =>
{
    routes.MapRoute(
        name: "default",
        template: "{controller=Home}/{action=Index}/{id?}");
});

app.UseHangfireDashboard(options: new DashboardOptions
{
    Authorization = new Hangfire.Dashboard.IDashboardAuthorizationFilter[0]
});
app.UseHangfireServer();

html source code

I made an action and it shows the culture value is received currently

public class HomeController : Controller
{
    public string GetCulture()
    {
        return $"CurrentCulture:{CultureInfo.CurrentCulture.Name}, CurrentUICulture:{CultureInfo.CurrentUICulture.Name}";
    }
}

コントリビューターガイド