Hi I am trying to implement localization in .net core. I want to implement localization in my views static content. By default it will show German and can be changed to other languages as well. I have configured it to set default culture to German, but it is not working. Please Help

What i have tried is:-

In my startup file

public void ConfigureServices(IServiceCollection services)

            //adding HttpContextAccessor middleware
            services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();

        services.AddRouting(options => options.LowercaseUrls = true);

        //configuration for multilanguage support


        //adding other services...

    // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
    public void Configure(IApplicationBuilder app, IHostingEnvironment env)
        if (env.IsDevelopment())

        var supportedCultures = new[]{
      new CultureInfo("en-US"),
      new CultureInfo("fr"),
      new CultureInfo("de"),


        app.UseRequestLocalization(new RequestLocalizationOptions
            DefaultRequestCulture = new RequestCulture("de"),
            // Formatting numbers, dates, etc.
            SupportedCultures = supportedCultures,
            // UI strings that we have localized.
            SupportedUICultures = supportedCultures


        //configuring mvc routes...
        app.UseMvc(routes =>
               name: "areaRoute",
               template: "{area:exists}/{controller}/{action}/{id?}",
               defaults: new { controller = "Home", action = "Index" });

                name: "default",
                template: "{controller}/{action}/{id?}",
                defaults: new { controller = "Home", action = "Index" });

In my View i have done this:-


to show the resource value

I am getting data from resource file but from English resource file because current culture is setting to English UK. I have getting output like this:

enter image description here

The current culture is showing as English, because of that the the message (Send Message English Culture) is coming from En.resx file.

0 Answers