From 42252be750436dd0070ce0ea0f041c07b3662261 Mon Sep 17 00:00:00 2001 From: "2248356998 qq.com" <2248356998@qq.com> Date: Tue, 4 Feb 2025 16:59:06 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BE=8B=E5=AD=90?= =?UTF-8?q?=EF=BC=8C=E6=BC=94=E7=A4=BA=E5=85=A5=E5=8F=A3=E7=A8=8B=E5=BA=8F?= =?UTF-8?q?=E9=87=8D=E5=86=99=E8=AF=AD=E8=A8=80=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/BootstrapBlazor.Server/Locales/en-US.json | 5 +++++ src/BootstrapBlazor/Locales/en.json | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 3e1db2f5b24..16604b7543e 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -1,4 +1,9 @@ { + "BootstrapBlazor.Components.AutoComplete": { + "NoDataTip": "No Data123456", + "PlaceHolder": "Please Input789" + }, + "BootstrapBlazor.Server.Components.Pages.Online": { "SubTitle": "Online population statistics", "ConnectionTime": "ConnectionTime", diff --git a/src/BootstrapBlazor/Locales/en.json b/src/BootstrapBlazor/Locales/en.json index 12d0d4c01a2..34b01ceac4a 100644 --- a/src/BootstrapBlazor/Locales/en.json +++ b/src/BootstrapBlazor/Locales/en.json @@ -1,8 +1,5 @@ { - "BootstrapBlazor.Components.AutoComplete": { - "NoDataTip": "No Data", - "PlaceHolder": "Please Input" - }, + "BootstrapBlazor.Components.Captcha": { "HeaderText": "Captcha", "BarText": "Slide to the right to solve puzzle", From 93d85029b664ff5abafad6f691ec83eb480cda5c Mon Sep 17 00:00:00 2001 From: "2248356998 qq.com" <2248356998@qq.com> Date: Tue, 4 Feb 2025 16:59:17 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=85=A5=E5=8F=A3?= =?UTF-8?q?=E7=A8=8B=E5=BA=8F=E9=87=8D=E5=86=99=E8=AF=AD=E8=A8=80=E8=B5=84?= =?UTF-8?q?=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/LocalizationOptionsExtensions.cs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs index 75896316dcb..ea6958bd1a6 100644 --- a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs +++ b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs @@ -27,10 +27,20 @@ public static IEnumerable GetJsonStringFromAssembly(this var builder = new ConfigurationBuilder(); // 获取程序集中的资源文件 - var assemblies = new List() { assembly }; + var assemblies = new HashSet() { assembly }; + + var entryAssembly = GetAssembly(); + if (assembly != entryAssembly) + { + assemblies.Add(entryAssembly); + } + if (option.AdditionalJsonAssemblies != null) { - assemblies.AddRange(option.AdditionalJsonAssemblies); + foreach (var item in option.AdditionalJsonAssemblies) + { + assemblies.Add(item); + } } var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList(); @@ -65,6 +75,9 @@ public static IEnumerable GetJsonStringFromAssembly(this } return config.GetChildren(); + + [ExcludeFromCodeCoverage] + Assembly GetAssembly() => Assembly.GetEntryAssembly() ?? assembly; } private static List GetResourceStream(this JsonLocalizationOptions option, Assembly assembly, string cultureName) From f930abd78db383b4800bdc359e0af302021a4bd0 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 5 Feb 2025 17:08:22 +0800 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=E9=87=8D=E6=9E=84=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Extensions/LocalizationOptionsExtensions.cs | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs index ea6958bd1a6..18609c782ae 100644 --- a/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs +++ b/src/BootstrapBlazor/Extensions/LocalizationOptionsExtensions.cs @@ -27,9 +27,11 @@ public static IEnumerable GetJsonStringFromAssembly(this var builder = new ConfigurationBuilder(); // 获取程序集中的资源文件 - var assemblies = new HashSet() { assembly }; + var assemblies = new List() { assembly }; - var entryAssembly = GetAssembly(); + // 获得主程序集资源文件 + // 支持合并操作 + var entryAssembly = GetEntryAssembly(); if (assembly != entryAssembly) { assemblies.Add(entryAssembly); @@ -37,10 +39,7 @@ public static IEnumerable GetJsonStringFromAssembly(this if (option.AdditionalJsonAssemblies != null) { - foreach (var item in option.AdditionalJsonAssemblies) - { - assemblies.Add(item); - } + assemblies.AddRange(option.AdditionalJsonAssemblies); } var streams = assemblies.SelectMany(i => option.GetResourceStream(i, cultureName)).ToList(); @@ -77,7 +76,7 @@ public static IEnumerable GetJsonStringFromAssembly(this return config.GetChildren(); [ExcludeFromCodeCoverage] - Assembly GetAssembly() => Assembly.GetEntryAssembly() ?? assembly; + Assembly GetEntryAssembly() => Assembly.GetEntryAssembly() ?? assembly; } private static List GetResourceStream(this JsonLocalizationOptions option, Assembly assembly, string cultureName) From cdf1d9fcb20ec513b69c54fb338fea934d3c362b Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 5 Feb 2025 17:12:47 +0800 Subject: [PATCH 4/5] chore: bump version 9.3.1-beta08 Co-Authored-By: Diego2098 <82756760+kimdiego2098@users.noreply.github.com> --- src/BootstrapBlazor/BootstrapBlazor.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BootstrapBlazor/BootstrapBlazor.csproj b/src/BootstrapBlazor/BootstrapBlazor.csproj index 2504a2d7b3c..14c98937acb 100644 --- a/src/BootstrapBlazor/BootstrapBlazor.csproj +++ b/src/BootstrapBlazor/BootstrapBlazor.csproj @@ -1,7 +1,7 @@ - 9.3.1-beta07 + 9.3.1-beta08 From 76b01173383dabb3b4214973f5876ead0153eaec Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Wed, 5 Feb 2025 17:14:00 +0800 Subject: [PATCH 5/5] =?UTF-8?q?Revert=20"=E5=A2=9E=E5=8A=A0=E4=BE=8B?= =?UTF-8?q?=E5=AD=90=EF=BC=8C=E6=BC=94=E7=A4=BA=E5=85=A5=E5=8F=A3=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E9=87=8D=E5=86=99=E8=AF=AD=E8=A8=80=E8=B5=84=E6=BA=90?= =?UTF-8?q?"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 42252be750436dd0070ce0ea0f041c07b3662261. --- src/BootstrapBlazor.Server/Locales/en-US.json | 5 ----- src/BootstrapBlazor/Locales/en.json | 5 ++++- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/BootstrapBlazor.Server/Locales/en-US.json b/src/BootstrapBlazor.Server/Locales/en-US.json index 22a2def6739..74bc53e1884 100644 --- a/src/BootstrapBlazor.Server/Locales/en-US.json +++ b/src/BootstrapBlazor.Server/Locales/en-US.json @@ -1,9 +1,4 @@ { - "BootstrapBlazor.Components.AutoComplete": { - "NoDataTip": "No Data123456", - "PlaceHolder": "Please Input789" - }, - "BootstrapBlazor.Server.Components.Pages.Online": { "SubTitle": "Online population statistics", "ConnectionTime": "ConnectionTime", diff --git a/src/BootstrapBlazor/Locales/en.json b/src/BootstrapBlazor/Locales/en.json index 34b01ceac4a..12d0d4c01a2 100644 --- a/src/BootstrapBlazor/Locales/en.json +++ b/src/BootstrapBlazor/Locales/en.json @@ -1,5 +1,8 @@ { - + "BootstrapBlazor.Components.AutoComplete": { + "NoDataTip": "No Data", + "PlaceHolder": "Please Input" + }, "BootstrapBlazor.Components.Captcha": { "HeaderText": "Captcha", "BarText": "Slide to the right to solve puzzle",