Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>is there any reason why you are using the session variable? a more common solution is to include the language code in the route, i.e. blah.com/en/info or blah.com/jp/info (for english and japanese)</p> <p>if you did this every page on the site could contain links to each language. if you are writing a publicly accessible site this would also make it easier for google to index all your content.</p> <p>this article explains how to include the language in the domain, ie. en.blah.com or jp.blah.com: <a href="http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx" rel="noreferrer">http://blog.maartenballiauw.be/post/2009/05/20/ASPNET-MVC-Domain-Routing.aspx</a></p> <p>UPDATED: Here's a <em>simple</em> example of including the language code in the URL route.</p> <p>Change the default route to include a language parameter:</p> <pre><code>routes.MapRoute( "Default", "{language}/{controller}/{action}/{id}", new { language = "en", controller = "Home", action = "Index", id = "" } ); </code></pre> <p>Add links for each language to your masterpage:</p> <pre><code>&lt;li&gt;&lt;%= Html.ActionLink( "Spanish", ViewContext.RouteData.Values["action"].ToString(), new { language = "es" })%&gt;&lt;/li&gt; &lt;li&gt;&lt;%= Html.ActionLink( "French", ViewContext.RouteData.Values["action"].ToString(), new { language = "fr" })%&gt;&lt;/li&gt; &lt;li&gt;&lt;%= Html.ActionLink( "English", ViewContext.RouteData.Values["action"].ToString(), new { language = "en" })%&gt;&lt;/li&gt; </code></pre> <p>These will render as links back to the page you are on - only with the language changed.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload