In addition to what terjetyl mentioned, in order to be able to change the culture, you need to add additional functionality to your controllers.
First, you need to create the following class (you can place it on the Controllers folder):
public class BaseController : Controller
{
protected override void ExecuteCore()
{
string cultureName = null;
// Attempt to read the culture cookie from Request
HttpCookie cultureCookie = Request.Cookies["_culture"];
// If there is a cookie already with the language, use the value for the translation, else uses the default language configured.
if (cultureCookie != null)
cultureName = cultureCookie.Value;
else
{
cultureName = ConfigurationManager.AppSettings["DefaultCultureName"];
cultureCookie = new HttpCookie("_culture");
cultureCookie.HttpOnly = false; // Not accessible by JS.
cultureCookie.Expires = DateTime.Now.AddYears(1);
}
// Validates the culture name.
cultureName = CultureHelper.GetImplementedCulture(cultureName);
// Sets the new language to the cookie.
cultureCookie.Value = cultureName;
// Sets the cookie on the response.
Response.Cookies.Add(cultureCookie);
// Modify current thread's cultures
Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo(cultureName);
Thread.CurrentThread.CurrentUICulture = Thread.CurrentThread.CurrentCulture;
base.ExecuteCore();
}
}
Then, you need to make every controller on your MVC project to inherit from the created class.
After this, you need to add the following code on namespaces tag on the Web.config on the Views folder.
<add namespace="complete assembly name of the resources project"/>
Finally, you need to add on the button where you change the language, the instructions to set the "_culture" cookie to the correct language code.
Let me know if you have any questions.