private void OnLangChanged(object sender, SelectionChangedEventArgs e) { var selLang = cmbLang.SelectedIndex; if (selLang != selectedLang) { LanguageSetting.SetLanguage((LanguageEnum)cmbLang.SelectedIndex); selectedLang = selLang; } }
public MainWindow() { InitializeComponent(); LanguageSetting.SetLanguage("he"); setBinding(); unitBtns.Visibility = Visibility.Hidden; }
public ActionResult SetLanguage(string lang) { var Path = Request.UrlReferrer.AbsolutePath; HttpCookie cultureCookie = new HttpCookie("culture"); cultureCookie.Value = lang; cultureCookie.Expires = DateTime.Now.AddDays(1); Response.SetCookie(cultureCookie); LanguageSetting.SetLanguage(lang); return(Redirect(Path)); }
protected override IAsyncResult BeginExecuteCore(AsyncCallback callback, object state) { string lang; var langCookie = Request.Cookies["culture"]; if (langCookie != null) { lang = langCookie.Value; } else { var userLanguage = Request.UserLanguages; lang = userLanguage != null ? userLanguage[0] : "ar"; } LanguageSetting.SetLanguage(lang); return(base.BeginExecuteCore(callback, state)); }
private void Button_Click2(object sender, RoutedEventArgs e) { LanguageSetting.SetLanguage("en"); setBinding(); }