title: ASP.NET Core MVC Localization Warning: AcceptLanguageHeaderRequestCultureProvider returned the following unsupported cultures
body: <p>I have an ASP.NET Core MVC app that use resource localization. It currently supports only one culture (fa-IR) and I want to all localizations be processed based on this culture. In ASP.NET Core 1.1 I have no issue but after migrating from ASP.NET Core 1.1 to 2.1 I see this warning for each HTTP request:</p>
  
  <blockquote>
    <p>AcceptLanguageHeaderRequestCultureProvider returned the following unsupported cultures 'en-US, en, fa'.</p>
  </blockquote>
  
  <p>This is my Startup:</p>
  
  <pre><code>public class Startup
  {
      protected CultureInfo DefaultCultureInfo { get; private set; } = new CultureInfo("fa-IR");
  
      public void ConfigureServices(IServiceCollection services)
      {
          CultureInfo.DefaultThreadCurrentCulture = DefaultCultureInfo;
          CultureInfo.DefaultThreadCurrentUICulture = DefaultCultureInfo;
          services.AddLocalization(options =&gt; { options.ResourcesPath = "Resources"; });
  
          services.AddMemoryCache();
          services.AddSession();
  
          services.AddMvc()
          .AddDataAnnotationsLocalization()
          .AddViewLocalization()
          .AddControllersAsServices()
          .SetCompatibilityVersion(CompatibilityVersion.Version_2_1)
          .AddSessionStateTempDataProvider();
  
          services.Configure&lt;RequestLocalizationOptions&gt;(options =&gt;
          {
              var supportedCultures = new[] { new CultureInfo("fa-IR"), new CultureInfo("en-US") };
              options.DefaultRequestCulture = new RequestCulture("fa-IR", "fa-IR");
              options.SupportedCultures = supportedCultures;
              options.SupportedUICultures = supportedCultures;
  
              options.RequestCultureProviders.Insert(0, new CustomRequestCultureProvider(async context =&gt;
              {
                  return new ProviderCultureResult("fa-IR");
              }));
          });
      }
  
      public void Configure(IApplicationBuilder app)
      {
          var supportedCultures = new[] { DefaultCultureInfo };
          app.UseRequestLocalization(new RequestLocalizationOptions()
          {
              DefaultRequestCulture = new RequestCulture(DefaultCultureInfo),
              SupportedCultures = supportedCultures,
              SupportedUICultures = supportedCultures,
              FallBackToParentCultures = true,
              FallBackToParentUICultures = true,
          });
  
          app.UseSession();
          app.UseMvc();
          app.UseCookiePolicy();
      }
  }
  </code></pre>
  
  <p>In fact it's just a warning, My app works fine but my log files are filled by this warning so I am searching for a way to make MVC know what I want.</p>
  
  <p>[Edit]: I have added CustomRequestCultureProvider but has no effect and after putting a breakpoint in that line realized that line does not get hit.</p>
  
  <p>[Edit2]: As user2429841 suggested I added "fa" to the supportedCultures the warnings gone but my resource files (that are named x.fa-IR.resx) are not picked up any more. Is there any way to say to MVC that if you get some culture treat it as another culture?</p>