ASP.NET 5 (Core 1.0) localization / multilanguage web application
<p>I have developed my first ASP.NET 5 web application with this characteristics:</p>

<ul>
<li>ASP.NET 5 (Core 1.0)</li>
<li>MVC 6</li>
<li>EF 7</li>
</ul>

<p>I'm trying to translate it to multilanguage and that the user could be able to change the language with a selector, but I'm not able to achieving.</p>

<p>I had developed ASP.NET 2.0/3.5 projects before, and I remember that the texts were into resource (.resx) files or into an XML file. But now, as a lot of things that has changed recently in the new ASP, I think the localization also has changed. </p>

<p>I have found very little information about it, and that I have found, doesn't help me enough.</p>

<p>In the official support website doesn't explain this topic yet (docs.asp.net).</p>

<p>I have found an <a href="https://github.com/damienbod/AspNet5Localization/tree/rc1" rel="nofollow">GitHub code sample</a>, and interesting explanation in <a href="http://damienbod.com/2015/10/21/asp-net-5-mvc-6-localization/" rel="nofollow">this website</a>.</p>

<p>But I'm no be able to linking concepts. I'm going to explain the steps that I have done.</p>

<p>I have created a "Resource" folder, into my ASP.NET project. Into this folder, I have created some (.resx) files. The name of this files follows the structure:</p>

<ul>
<li>Controllers.NameOfController.ca-ES.resx</li>
<li>Views.NameOfView.ca-ES.resx</li>
<li>Models.NameOfModel.ca-ES.resx</li>
</ul>

<p>In my Startup.cs file, I have defined the following code to set which folder are the text resources:</p>

<pre><code>        public void ConfigureServices(IServiceCollection services)
    {
       ...
        services
            .AddMvc()
            .AddViewLocalization(options =&gt; options.ResourcesPath = "Resources")
            .AddDataAnnotationsLocalization();
       ...
   }
</code></pre>

<p>In the same file, in the Configure method, I have defined:</p>

<pre><code>            app.UseMvc(routes =&gt;
        {
            routes.MapRoute(
                name: "default",
                template: "{controller=Home}/{action=Index}/{id?}");
                //template: "{culture?}/{controller}/{action}/{id?}", //we define the structure of the routes
                //defaults: new { culture = "ca", controller = "Home", action = "Index" }); //we define the default values
        });
</code></pre>

<p>And also in the same function, the supported cultures:</p>

<pre><code>        //To set the localization configuration
        List&lt;CultureInfo&gt; supportedCultures = new List&lt;CultureInfo&gt;();
        supportedCultures.Add(new CultureInfo("ca-ES"));
        supportedCultures.Add(new CultureInfo("es-ES"));

        List&lt;CultureInfo&gt; supportedUICultures = new List&lt;CultureInfo&gt;();
        supportedUICultures.Add(new CultureInfo("ca-ES"));
        supportedUICultures.Add(new CultureInfo("es-ES"));               

        RequestLocalizationOptions requestLocalizationOptions = new RequestLocalizationOptions();            
        requestLocalizationOptions.SupportedCultures = supportedCultures;
        requestLocalizationOptions.SupportedUICultures = supportedUICultures;            

        RequestCulture defaultRequestCulture = new RequestCulture("ca-ES");
        app.UseRequestLocalization(requestLocalizationOptions, defaultRequestCulture);
</code></pre>

<p>And now is the point that I'm lost.</p>

<ul>
<li>I have read, that I have to develop an controller class that beacome
the responsible to manage the localization. I'm right?</li>
<li>I have read, that exists multiple ways to define the language that I have to display: from the query string, from a cookie, from the Accept-Language HTTP
header, from the DefaultRequestCulture property of the
RequestLocalizationOptions class, from the thread culture. I don't know if I have to consider all of this options or one is enough.</li>
<li>.resx are active? Are they the good solution? Can I use it in ASP :NET 5?</li>
<li>How I can do a selector to commute the language?</li>
</ul>

<p><strong>EDIT:</strong></p>

<p>I have checked the <a href="https://docs.asp.net/en/latest/fundamentals/localization.html" rel="nofollow">documentation</a> again, and I have seen in the comments that Rick Anderson has been writing an <a href="https://docs.asp.net/en/1.0.0-rc2/fundamentals/localization.html" rel="nofollow">entry</a>. I haven't read it in calm yet, but I share with you if somebody is interested about this topic.</p>