Beispiel #1
0
        void App_Startup(object sender, StartupEventArgs e)
        {
            AppDomain.CurrentDomain.AssemblyResolve += OnResolveAssembly;
            Translation = KaedeEngine.KaedeEngine.LoadLocale(Settings.Default.PreferredLocale);

            AkemiSwitcherUI window = new AkemiSwitcherUI();

            uiRef = window;

            int sIndex = 0;

            foreach (LocalePreview l in Translation.AllLocales)
            {
                window.languageSelectionBox.Items.Add(l.LocalisedName);
                if (l.Id == Translation.Locale.Id)
                {
                    window.languageSelectionBox.SelectedIndex = sIndex;
                }
                sIndex++;
            }

            window.btnSwitch.Background = this.FindResource("ButtonStateDisabled") as Brush;
            window.btnSwitch.IsEnabled  = false;
            window.btnSwitch.Content    = Translation.GetString("info_wait");
            window.versionText.Content  = string.Format("{0} v{1}",
                                                        System.Reflection.Assembly.GetEntryAssembly().GetName().Name,
                                                        System.Reflection.Assembly.GetEntryAssembly().GetName().Version.ToString()
                                                        );

            window.Show();

            switcher.OnSwitcherMessage += onSwitcherMessage;
            switcher.Prepare();
        }
Beispiel #2
0
 public string GetTranslationString(string x)
 {
     return(Translation.GetString(x));
 }