From ba6207f52db76ab47cd6534de0cf1712674ff179 Mon Sep 17 00:00:00 2001
From: alielie <alielie@git.com>
Date: 星期四, 13 三月 2025 09:00:46 +0800
Subject: [PATCH] 完善国际化语言;
---
WPFProject/App.xaml.cs | 20 ++------------------
1 files changed, 2 insertions(+), 18 deletions(-)
diff --git a/WPFProject/App.xaml.cs b/WPFProject/App.xaml.cs
index 2a6f66f..8a44641 100644
--- a/WPFProject/App.xaml.cs
+++ b/WPFProject/App.xaml.cs
@@ -3,9 +3,7 @@
using log4net;
using Panuon.WPF.UI;
using System;
-using System.IO;
using System.Windows;
-using System.Windows.Markup;
using WPFProject.Utils;
namespace WPFProject
@@ -26,12 +24,9 @@
{
var ex = e.ExceptionObject as Exception;
log.Error("UnhandledException.", ex);
- Dispatcher.Invoke(() =>
- {
- MsgBoxHelper.ErrorMessage(Current.MainWindow, $"鍙戠敓鏈煡寮傚父锛佺▼搴忓嵆灏嗗叧闂璡r\n{ex?.Message}",
- "閿欒", MessageBoxButton.OK,
+ MsgBoxHelper.ErrorMessage(Current.MainWindow, this.lang("App.AppUnhandledException",ex.Message),
+ this.lang("App.Error"), MessageBoxButton.OK,
MessageBoxIcon.Error, DefaultButton.YesOK, 5);
- });
}
private void Application_Startup(object sender, StartupEventArgs e)
@@ -41,17 +36,6 @@
LoadingWindow window = new LoadingWindow();
//Login window = new Login();
window.Show();
- }
-
-
- private void LoadLang()
- {
- string path = "Lang/zh-CN/app.xaml";
- using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
- {
- var dict = (ResourceDictionary)XamlReader.Load(fs);
- Application.Current.Resources.MergedDictionaries.Add(dict);
- }
}
}
}
--
Gitblit v1.9.1