Get the current culture in a controller asp.net-core

前端 未结 5 911
隐瞒了意图╮
隐瞒了意图╮ 2021-02-05 01:26

I have setup the cultures for my views and changing the culture in a controller but I can\'t seem to find how to know what culture I\'m currently using in a controller, I\'m loo

5条回答
  •  伪装坚强ぢ
    2021-02-05 01:58

    This code works for getting current culture in asp core controller:

    public string GetCulture() => $"CurrentCulture:{CultureInfo.CurrentCulture.Name}, CurrentUICulture:{CultureInfo.CurrentUICulture.Name}";
    

提交回复
热议问题