public static LoadLanguageFromUserData ( ) : string | ||
Результат | string |
/// <summary> /// Loads language and time zone settings. /// </summary> private void LoadLanguageAndTimezoneSettings() { // Load hard-stored settings // If not available, look for cookie // If not available, load defaults string culture = Preferences.LoadLanguageFromUserData(); if (culture == null) { culture = Preferences.LoadLanguageFromCookie(); } if (culture == null) { culture = Settings.DefaultLanguage; } int?tempTimezone = Preferences.LoadTimezoneFromUserData(); if (!tempTimezone.HasValue) { tempTimezone = Preferences.LoadTimezoneFromCookie(); } if (!tempTimezone.HasValue) { tempTimezone = Settings.DefaultTimezone; } languageSelector.SelectedLanguage = culture; languageSelector.SelectedTimezone = tempTimezone.ToString(); }
/// <summary> /// Loads language and time zone settings. /// </summary> private void LoadLanguageAndTimezoneSettings() { // Load hard-stored settings // If not available, look for cookie // If not available, load defaults string culture = Preferences.LoadLanguageFromUserData(currentWiki); if (culture == null) { culture = Preferences.LoadLanguageFromCookie(); } if (culture == null) { culture = Settings.GetDefaultLanguage(currentWiki); } string tempTimezone = Preferences.LoadTimezoneFromUserData(currentWiki); if (string.IsNullOrEmpty(tempTimezone)) { tempTimezone = Preferences.LoadTimezoneFromCookie(); } if (string.IsNullOrEmpty(tempTimezone)) { tempTimezone = Settings.GetDefaultTimezone(currentWiki); } languageSelector.SelectedLanguage = culture; languageSelector.SelectedTimezone = tempTimezone; }
protected override void InitializeCulture() { // First, look for hard-stored user preferences // If they are not available, look at the cookie string culture = Preferences.LoadLanguageFromUserData(); if (culture == null) { culture = Preferences.LoadLanguageFromCookie(); } if (culture != null) { Thread.CurrentThread.CurrentCulture = new CultureInfo(culture); Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); } else { try { if (Settings.DefaultLanguage.Equals("-")) { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); } else { Thread.CurrentThread.CurrentCulture = new CultureInfo(Settings.DefaultLanguage); Thread.CurrentThread.CurrentUICulture = new CultureInfo(Settings.DefaultLanguage); } } catch { Thread.CurrentThread.CurrentCulture = new CultureInfo("en-US"); Thread.CurrentThread.CurrentUICulture = new CultureInfo("en-US"); } } //Response.Write("Culture: " + Thread.CurrentThread.CurrentCulture.Name + "<br />"); //Response.Write("UICulture: " + Thread.CurrentThread.CurrentUICulture.Name + "</br >"); }