public LoaderViewModel(IWindowManager windowManager, IEventAggregator events)
        {
            if (Properties.Settings.Default.UpgradeRequired)
            {
                Properties.Settings.Default.Upgrade();
                Properties.Settings.Default.UpgradeRequired = false;
                Properties.Settings.Default.Save();
            }

            _windowManager = windowManager;
            _events        = events;
            _events.Subscribe(this);
            _titleText = $"{Global.ApplicationName} {VersionHelper.PublishVersion} {VersionHelper.PublishBuild}";
            LocalizeDictionary.Instance.SetCurrentThreadCulture = true;
            var languages = LocalizationEx.GetSupportedLanguages();

            if (!string.IsNullOrEmpty(Properties.Settings.Default.PreferredLanguage))
            {
                Log.Info($"Preferred language: {Properties.Settings.Default.PreferredLanguage}");
                var preferredLanguage = languages.FirstOrDefault(l => l.ShortCode.Equals(Properties.Settings.Default.PreferredLanguage));
                LocalizeDictionary.Instance.Culture = preferredLanguage != null ? new CultureInfo(preferredLanguage.CultureCode) : Thread.CurrentThread.CurrentCulture;
            }
            else
            {
                var language = languages.FirstOrDefault(l =>
                                                        l.ShortCode.Equals(Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName));
                if (language != null)
                {
                    Log.Info($"Using {language.ShortCode} as language");
                    LocalizeDictionary.Instance.Culture = new CultureInfo(language.CultureCode);
                }
                else
                {
                    Log.Warn($"Translation for {Thread.CurrentThread.CurrentCulture.TwoLetterISOLanguageName} is not available");
                    LocalizeDictionary.Instance.Culture = new CultureInfo("en");
                }
            }

            var selectedLanguage = languages.SingleOrDefault(l => l.ShortCode.Equals(LocalizeDictionary.Instance.Culture.TwoLetterISOLanguageName)) ??
                                   languages.SingleOrDefault(l => l.ShortCode.Equals(LocalizeDictionary.Instance.Culture.Name));


            _mainViewModel = new MainViewModel(_windowManager, _events)
            {
                Languages        = languages,
                SelectedLanguage = selectedLanguage
            };
            _systemTrayViewModel = new SystemTrayViewModel(_windowManager, _events, _mainViewModel);

            InitializeApplication();
        }