Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I believe you need to write code to <strong>read the user's culture from the incoming browser request</strong>, and set your CultureInfo from that.</p> <p><a href="http://bytes.com/topic/asp-net/answers/314356-regional-settings-en-gb-cultureinfo-currentculture-name-en-us" rel="nofollow noreferrer">This fellow describes how they do it</a>: Set the display culture for the current thread to the most appropriate culture from the user's incoming Http "request" object.</p> <p>He has an excellent discussion there, but this is basically how he does it:</p> <p>In <code>Page_Load</code>, they make this call: <code>UIUtilities.setCulture(Request);</code></p> <p>Where this is what gets called:</p> <pre><code>/// Set the display culture for the current thread to the most /// appropriate culture from the user's incoming Http "request" object. internal static void setCulture(HttpRequest request) { if (request != null) { if (request.UserLanguages != null) { if (request.UserLanguages.Length &gt; -1) { string cultureName = request.UserLanguages[0]; UIUtilities.setCulture(cultureName); } } // TODO: Set to a (system-wide, or possibly user-specified) default // culture if the browser didn't give us any clues. } } /// Set the display culture for the current thread to a particular named culture. /// &lt;param name="cultureName"&gt;The name of the culture to be set /// for the thread&lt;/param&gt; private static void setCulture(string cultureName) { Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(cultureName); Thread.CurrentThread.CurrentUICulture = new CultureInfo(cultureName); } </code></pre>
 

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