title: ASP.NET MVC 4 Globalization
body: <p>I am new to ASP.NET and I want to design a multilingual Website.<br/>
  I want to let users select their language from a menu bar on top of the home page and let them also see it on address bar of web browser.<br/>
  to do so I added below codes to <code>RouteConfig</code> Class :</p>
  
  <pre><code>routes.MapRoute(
          name; "Default",
          url: "{lang}/{controller}/{action}/{id}",
          new { controller = "Home", action = "Index", id = UrlParameter.Optional }
      )
  </code></pre>
  
  <p>First of all I can't Set <code>CultureInfo</code> in <code>CurrentThread</code>. I created <code>CultureController</code> and In there I set the Language based on user's choice. It won't change in other Views and Controllers. (I have heard every user get one thread when they enter website )</p>
  
  <pre><code>        public ActionResult ChangeLanguage ( string lang, String returnUrl = null )
          {
              if ( !new[] { "en", "fr", "ar" }.Contains( lang ) )
                  throw new ArgumentException( "Language not supported." );
  
              Thread.CurrentThread.CurrentCulture = CultureInfo.GetCultureInfo( lang );
  
              if ( returnUrl == null )
                  return RedirectToAction( "Index", "Home" );
  
              return Redirect( returnUrl );
          }
  </code></pre>
  
  <p>Second Problem: now I should pass lang in my links too and I don't want to. for example:</p>
  
  <pre><code>@Html.ActionLink("About", "About", "Home")
  </code></pre>
  
  <p>doesn't work anymore. I want the lang param get filled based on <code>CultureInfo</code> stored in <code>CurrentThread</code> or Session. ( I currently use Session ). ( Is It even possible??!! )<br />
  I appreciate any help.</p>