From 24d1de0b238efc5668eae1ad76e954bd10c20c10 Mon Sep 17 00:00:00 2001 From: Jack <3486688394@qq.com> Date: Thu, 23 Jan 2025 23:02:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BC=98=E5=8C=96=E6=9E=84?= =?UTF-8?q?=E9=80=A0=E5=87=BD=E6=95=B0=E5=B9=B6=E8=B0=83=E6=95=B4=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- JackCraft.I18N.sln.DotSettings.user | 1 + JackCraft.I18N/I18NManager.cs | 4 ++-- Test/App.axaml.cs | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/JackCraft.I18N.sln.DotSettings.user b/JackCraft.I18N.sln.DotSettings.user index 3400518..b5fbb10 100644 --- a/JackCraft.I18N.sln.DotSettings.user +++ b/JackCraft.I18N.sln.DotSettings.user @@ -1,6 +1,7 @@  ForceIncluded ForceIncluded + ForceIncluded ForceIncluded ForceIncluded ForceIncluded diff --git a/JackCraft.I18N/I18NManager.cs b/JackCraft.I18N/I18NManager.cs index 25a74bb..35842c8 100644 --- a/JackCraft.I18N/I18NManager.cs +++ b/JackCraft.I18N/I18NManager.cs @@ -8,10 +8,10 @@ namespace JackCraft.I18N; public sealed class I18NManager : INotifyPropertyChanged { - public I18NManager(string baseName, Assembly assembly) + public I18NManager(string baseName, Assembly? assembly = null) { I18NConfig.BaseName = baseName; - I18NConfig.Assembly = assembly; + I18NConfig.Assembly = assembly ?? Assembly.GetCallingAssembly(); I18NConfig.Manager = this; } diff --git a/Test/App.axaml.cs b/Test/App.axaml.cs index 0ba308e..16e17ab 100644 --- a/Test/App.axaml.cs +++ b/Test/App.axaml.cs @@ -8,7 +8,7 @@ namespace Test; public class App : Application { - public static I18NManager I18NManager { get; set; } = new("Test.Assets.Resources", typeof(App).Assembly); + public static I18NManager I18NManager { get; } = new("Test.Assets.Resources"); public override void Initialize() {