Exemplo n.º 1
0
 private void FinishUiLanguageMenuItemClick()
 {
     // these lines deal with having a smaller workspace window and minimizing the button texts for smaller windows
     SaveOriginalButtonTexts();
     AdjustButtonTextsForLocale();
     _localizationChangedEvent.Raise(null);
 }
Exemplo n.º 2
0
        private void SetupUiLanguageMenu()
        {
            SetupUiLanguageMenuCommon(_uiLanguageMenu, FinishUiLanguageMenuItemClick);

            _uiLanguageMenu.DropDownItems.Add(new ToolStripSeparator());
            var menu = _uiLanguageMenu.DropDownItems.Add(LocalizationManager.GetString("CollectionTab.MoreLanguagesMenuItem", "More..."));

            menu.Click += new EventHandler((a, b) =>
            {
                _localizationManager.ShowLocalizationDialogBox(false);
                SetupUiLanguageMenu();
                LocalizationManager.ReapplyLocalizationsToAllObjectsInAllManagers();                 //review: added this based on its name... does it help?
                _localizationChangedEvent.Raise(null);
                // The following is needed for proper display on Linux, and doesn't hurt anything on Windows.
                // See http://issues.bloomlibrary.org/youtrack/issue/BL-3444.
                AdjustButtonTextsForCurrentSize();
            });
        }
Exemplo n.º 3
0
        private void SetupUILanguageMenu()
        {
            _uiLanguageMenu.DropDownItems.Clear();
            foreach (var lang in L10NSharp.LocalizationManager.GetUILanguages(true))
            {
                string englishName = "";
                var    langaugeNamesRecognizableByOtherLatinScriptReaders = new List <string> {
                    "en", "fr", "es", "it", "tpi"
                };
                if ((lang.EnglishName != lang.NativeName) && !(langaugeNamesRecognizableByOtherLatinScriptReaders.Contains(lang.Name)))
                {
                    englishName = " (" + lang.EnglishName + ")";
                }
                var item = _uiLanguageMenu.DropDownItems.Add(lang.NativeName + englishName);
                item.Tag    = lang;
                item.Click += new EventHandler((a, b) =>
                {
                    L10NSharp.LocalizationManager.SetUILanguage(((CultureInfo)item.Tag).IetfLanguageTag, true);
                    Settings.Default.UserInterfaceLanguage = ((CultureInfo)item.Tag).IetfLanguageTag;
                    item.Select();
                    _uiLanguageMenu.Text = ((CultureInfo)item.Tag).NativeName;
                    _localizationChangedEvent.Raise(null);
                });
                if (((CultureInfo)item.Tag).IetfLanguageTag == Settings.Default.UserInterfaceLanguage)
                {
                    //doesn't do anything item.Select();

                    _uiLanguageMenu.Text = ((CultureInfo)item.Tag).NativeName;
                }
            }


            _uiLanguageMenu.DropDownItems.Add(new ToolStripSeparator());
            var menu = _uiLanguageMenu.DropDownItems.Add(LocalizationManager.GetString("CollectionTab.menuToBringUpLocalizationDialog", "More..."));

            menu.Click += new EventHandler((a, b) =>
            {
                _localizationManager.ShowLocalizationDialogBox(false);
                SetupUILanguageMenu();
                LocalizationManager.ReapplyLocalizationsToAllObjectsInAllManagers();                                                                                 //review: added this based on its name... does it help?
                _localizationChangedEvent.Raise(null);
            });
        }