public static GetCurrentLanguageDisplayName ( ) : string | ||
return | string |
private void SetupLanguages() { languageManager = LanguageManager.GetInstance(); LanguagesListView.ItemsSource = languageManager.LanguageDisplayNames; LanguagesListView.SelectedItem = LanguageManager.GetCurrentLanguageDisplayName(); }
private void PopupNo_Clicked(object sender, RoutedEventArgs e) { var curLang = LanguageManager.GetCurrentLanguageDisplayName(); if (curLang.Equals(PopupNo.Content as string)) { Common.LangApplyRebootRequired = false; LangApplyStack.Visibility = Visibility.Collapsed; } else { var langReturned = languageManager.UpdateLanguage(PopupNo.Content as string, false); } LanguagesListView.SelectedItem = LanguageManager.GetCurrentLanguageDisplayName(); if (StandardPopup.IsOpen) { StandardPopup.IsOpen = false; } //Check existing lang Tuple var currentLangTuple = languageManager.GetLanguageTuple(languageManager.GetLanguageTagFromDisplayName(LanguagesListView.SelectedItem as string)); SpeechSupport.Text = currentLangTuple.Item2 ? languageManager["SpeechSupportText"] : languageManager["SpeechNotSupportText"]; //Enable only if selected lang supports speech or image localization if (currentLangTuple.Item1 || currentLangTuple.Item2) { Common.LangApplyRebootRequired = true; LangApplyStack.Visibility = Visibility.Visible; } }
private void SetupLanguages() { languageManager = new LanguageManager(); LanguagesListBox.ItemsSource = languageManager.LanguageDisplayNames; LanguagesListBox.SelectedItem = LanguageManager.GetCurrentLanguageDisplayName(); }
private void SetupLanguages() { languageManager = LanguageManager.GetInstance(); LanguageComboBox.ItemsSource = languageManager.LanguageDisplayNames; LanguageComboBox.SelectedItem = LanguageManager.GetCurrentLanguageDisplayName(); InputLanguageComboBox.ItemsSource = languageManager.InputLanguageDisplayNames; InputLanguageComboBox.SelectedItem = LanguageManager.GetCurrentInputLanguageDisplayName(); }
private void SetupLanguages() { languageManager = new LanguageManager(); LanguageComboBox.ItemsSource = languageManager.LanguageDisplayNames; LanguageComboBox.SelectedItem = LanguageManager.GetCurrentLanguageDisplayName(); TimeZoneComboBox.ItemsSource = LanguageManager.GetSupportedTimeZones(); TimeZoneComboBox.SelectedItem = LanguageManager.GetCurrentTimeZone(); }
private void LanguagesListBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { if (LanguageManager.GetCurrentLanguageDisplayName().Equals(LanguagesListView.SelectedItem as string)) { Common.LangApplyRebootRequired = false; LangApplyStack.Visibility = Visibility.Collapsed; //Do Nothing return; } SetPreferences(); }
private void SetPreferences() { if (null == LanguagesListView.SelectedItem) { NavigationUtils.NavigateToScreen(typeof(MainPage)); } else { LangApplyStack.Visibility = Visibility.Collapsed; string selectedLanguage = LanguagesListView.SelectedItem as string; //Check existing lang Tuple var currentLangTuple = languageManager.GetLanguageTuple(languageManager.GetLanguageTagFromDisplayName(selectedLanguage)); SpeechSupport.Text = currentLangTuple.Item2 ? languageManager["SpeechSupportText"] : languageManager["SpeechNotSupportText"]; if (LanguageManager.GetCurrentLanguageDisplayName().Equals(selectedLanguage)) { //Do Nothing return; } //Check if selected language is part of ffu var newLang = languageManager.CheckUpdateLanguage(selectedLanguage); if (LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4).Equals(selectedLanguage)) { //Update var langReturned = languageManager.UpdateLanguage(selectedLanguage); //ffu list, Show user to restart to use the System Languages if (newLang.Item1) { Common.LangApplyRebootRequired = true; LangApplyStack.Visibility = Visibility.Visible; } //else //skip providing option to restart app } else { if (newLang.Item2) { //Stop Automatic counter to switch to next screen timer.Stop(); countdown.Stop(); ChooseDefaultLanguage.Visibility = Visibility.Collapsed; CancelButton.Visibility = Visibility.Collapsed; //If different, show the popup for confirmation PopupText2.Text = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupYes.Content = LanguageManager.GetDisplayNameFromLanguageTag(newLang.Item4); PopupText1.Text = languageManager["LanguagePopupText1"]; PopupText3.Text = languageManager["LanguagePopupText3"]; PopupNo.Content = LanguagesListView.SelectedItem as string; double hOffset = (Window.Current.Bounds.Width) / 4; double vOffset = (Window.Current.Bounds.Height) / 2; StandardPopup.VerticalOffset = vOffset; StandardPopup.HorizontalOffset = hOffset; if (!StandardPopup.IsOpen) { StandardPopup.IsOpen = true; } } else { //Just update silently in the background and dont ask for restart app var langReturned = languageManager.UpdateLanguage(selectedLanguage); } } } }