title: View localization
body: <p>I am trying to localize my ASP.NET Core application. I want to localize the Views using a ViewLocalizer and <code>@Localizer["Teststring"]</code>. 
  In my Startup.cs i do:</p>
  
  <pre><code>    public void ConfigureServices(IServiceCollection services)
      {
  
          services.AddLocalization();
  
          services.AddMvc()
              .AddViewLocalization(LanguageViewLocationExpanderFormat.Suffix)
              .AddDataAnnotationsLocalization();
  
          services.Configure&lt;RequestLocalizationOptions&gt;(options =&gt;
          {
              var supportedCultures = new[]
              {
                  new CultureInfo("en"),
                  new CultureInfo("es"),
                  new CultureInfo("de"),
                  new CultureInfo("fr"),
              };
  
              options.DefaultRequestCulture = new RequestCulture(culture: "en", uiCulture: "en");
  
              options.SupportedCultures = supportedCultures;
              options.SupportedUICultures = supportedCultures;
          });
  
  
      }
  
      public void Configure(IApplicationBuilder app, IHostingEnvironment env)
      {
  
          var locOptions = app.ApplicationServices.GetService&lt;IOptions&lt;RequestLocalizationOptions&gt;&gt;();
          app.UseRequestLocalization(locOptions.Value);
  
          if (env.IsDevelopment())
          {
              app.UseBrowserLink();
              app.UseDeveloperExceptionPage();
          }
          else
          {
              app.UseExceptionHandler("/Home/Error");
          }
  
          app.UseStaticFiles();
  
          app.UseMvc(routes =&gt;
          {
              routes.MapRoute(
                  name: "default",
                  template: "{controller=Home}/{action=Index}/{id?}");
          });
      }
  </code></pre>
  
  <p>I added a possibility to set the language which uses this method in my controller:</p>
  
  <pre><code>    [HttpPost]
      public IActionResult SetLanguage(string culture, string returnUrl)
      {
          Response.Cookies.Append(
              CookieRequestCultureProvider.DefaultCookieName,
              CookieRequestCultureProvider.MakeCookieValue(new RequestCulture(culture)),
              new CookieOptions { Expires = DateTimeOffset.UtcNow.AddYears(1) }
          );
  
          return LocalRedirect(returnUrl);
      }
  </code></pre>
  
  <p>My resource file for the german version of the Home/Index for example is named <code>Views.Home.Index.de.resx</code>.
  Sadly the selection of a language doesn't change the strings and I can't figure out what I'm doing wrong. The setlanguage method is called correctly.</p>