From 7fdb0ac1c6e32bc6ba7a08a12383e60195c9d6f4 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 21 Sep 2025 00:43:33 +0800 Subject: [PATCH] Fix issue that strings with parameters are not parsed automatically --- .../Localize/LocalizeSourceGenerator.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs b/Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs index 200ca95..3365a99 100644 --- a/Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs +++ b/Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs @@ -24,7 +24,6 @@ public partial class LocalizeSourceGenerator : IIncrementalGenerator private static readonly Version PackageVersion = typeof(LocalizeSourceGenerator).Assembly.GetName().Version; private static readonly ImmutableArray _emptyLocalizableStrings = ImmutableArray.Empty; - private static readonly ImmutableArray _emptyLocalizableStringParams = ImmutableArray.Empty; #endregion @@ -355,7 +354,8 @@ private static (string Summary, ImmutableArray Parameter { if (comment == null || comment.Value == null || parameters.Count == 0) { - return (null, _emptyLocalizableStringParams); + // If the comment is not a valid XML, the summary is null and the parameters are not updated + return (null, parameters.ToImmutableArray()); } try @@ -385,7 +385,8 @@ private static (string Summary, ImmutableArray Parameter } catch { - return (null, _emptyLocalizableStringParams); + // If the comment is not a valid XML, the summary is null and the parameters are not updated + return (null, parameters.ToImmutableArray()); } }