Skip to content

Commit 4edbef5

Browse files
authored
Merge pull request #37 from Flow-Launcher/suppress_warning
Suppress warning for old localization API usage in generated codes
2 parents 90867d2 + d698da5 commit 4edbef5

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

Flow.Launcher.Localization.Shared/Constants.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ public static class Constants
2828
public const string PublicApiClassName = "PublicApi";
2929
public const string PublicApiPrivatePropertyName = "instance";
3030
public const string PublicApiInternalPropertyName = "Instance";
31+
public const string SuppressWarning = "#pragma warning disable FLAN0001 // Old localization API used";
3132

3233
public static readonly Regex LanguagesXamlRegex = new Regex(@"\\Languages\\[^\\]+\.xaml$", RegexOptions.IgnoreCase);
3334
public static readonly string[] OldLocalizationClasses = { "IPublicAPI", "Internationalization" };

Flow.Launcher.Localization.SourceGenerators/Localize/EnumSourceGenerator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,10 @@ private void GenerateSource(
193193
sourceBuilder.AppendLine($"namespace {enumNamespace};");
194194
sourceBuilder.AppendLine();
195195

196+
// Suppress warning for old localization API usage
197+
sourceBuilder.AppendLine(Constants.SuppressWarning);
198+
sourceBuilder.AppendLine();
199+
196200
// Generate class
197201
sourceBuilder.AppendLine($"/// <summary>");
198202
sourceBuilder.AppendLine($"/// Data class for <see cref=\"{enumFullName}\"/>");

Flow.Launcher.Localization.SourceGenerators/Localize/LocalizeSourceGenerator.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,6 +473,10 @@ private static void GenerateSource(
473473
sourceBuilder.AppendLine($"namespace {assemblyNamespace};");
474474
sourceBuilder.AppendLine();
475475

476+
// Suppress warning for old localization API usage
477+
sourceBuilder.AppendLine(Constants.SuppressWarning);
478+
sourceBuilder.AppendLine();
479+
476480
// Uncomment them for debugging
477481
//sourceBuilder.AppendLine("/*");
478482
/*// Generate all localization strings

0 commit comments

Comments
 (0)