设置CultureInfo语言时遇到问题

时间:2019-07-22 03:02:58

标签: cultureinfo asp.net-core-mvc-2.1

我设置了列表语言“ en-EN”,“ vi-VN”,“ cn-ZH”。并且默认语言是“ en-EN”。但是系统显示的默认语言是“ vi-VN”

// Add framework services.  
        services.AddLocalization(options => options.ResourcesPath = "Resources");

        services.Configure<RequestLocalizationOptions>(options =>
        {
            var supportedCultures = new[]
            {
            new CultureInfo("en-US"),
            new CultureInfo("vi-VN"),
            new CultureInfo("zh-CN")
            };

            options.DefaultRequestCulture = new RequestCulture(culture: "en-US", uiCulture: "en-US");
            options.SupportedCultures = supportedCultures;
            options.SupportedUICultures = supportedCultures;

        });

enter image description here

0 个答案:

没有答案