|
2 | 2 | #nullable enable |
3 | 3 | using System; |
4 | 4 | using System.Collections.Concurrent; |
| 5 | +using System.Globalization; |
5 | 6 | using Humanizer; |
6 | 7 | using Microsoft.CodeAnalysis; |
7 | 8 |
|
@@ -92,47 +93,47 @@ public Diagnostic Push(string product, Diagnostic diagnostic) |
92 | 93 |
|
93 | 94 | static DiagnosticDescriptor CreateSponsor(string[] sponsorable, string prefix) => new( |
94 | 95 | $"{prefix}100", |
95 | | - ThisAssembly.Strings.Sponsor.Title, |
96 | | - ThisAssembly.Strings.Sponsor.MessageFormat, |
| 96 | + Resources.Sponsor_Title, |
| 97 | + Resources.Sponsor_Message, |
97 | 98 | "SponsorLink", |
98 | 99 | DiagnosticSeverity.Info, |
99 | 100 | isEnabledByDefault: true, |
100 | | - description: ThisAssembly.Strings.Sponsor.Description, |
| 101 | + description: Resources.Sponsor_Description, |
101 | 102 | helpLinkUri: "https://github.com/devlooped#sponsorlink", |
102 | 103 | "DoesNotSupportF1Help"); |
103 | 104 |
|
104 | 105 | static DiagnosticDescriptor CreateUnknown(string[] sponsorable, string product, string prefix) => new( |
105 | 106 | $"{prefix}101", |
106 | | - ThisAssembly.Strings.Unknown.Title, |
107 | | - ThisAssembly.Strings.Unknown.MessageFormat, |
| 107 | + Resources.Unknown_Title, |
| 108 | + Resources.Unknown_Message, |
108 | 109 | "SponsorLink", |
109 | 110 | DiagnosticSeverity.Warning, |
110 | 111 | isEnabledByDefault: true, |
111 | | - description: ThisAssembly.Strings.Unknown.Description( |
| 112 | + description: string.Format(CultureInfo.CurrentCulture, Resources.Unknown_Description, |
112 | 113 | sponsorable.Humanize(x => $"https://github.com/sponsors/{x}"), |
113 | 114 | string.Join(" ", sponsorable)), |
114 | 115 | helpLinkUri: "https://github.com/devlooped#sponsorlink", |
115 | 116 | WellKnownDiagnosticTags.NotConfigurable); |
116 | 117 |
|
117 | 118 | static DiagnosticDescriptor CreateExpiring(string[] sponsorable, string prefix) => new( |
118 | 119 | $"{prefix}103", |
119 | | - ThisAssembly.Strings.Expiring.Title, |
120 | | - ThisAssembly.Strings.Expiring.MessageFormat, |
| 120 | + Resources.Expiring_Title, |
| 121 | + Resources.Expiring_Message, |
121 | 122 | "SponsorLink", |
122 | 123 | DiagnosticSeverity.Warning, |
123 | 124 | isEnabledByDefault: true, |
124 | | - description: ThisAssembly.Strings.Expiring.Description(string.Join(" ", sponsorable)), |
| 125 | + description: string.Format(CultureInfo.CurrentCulture, Resources.Expiring_Description, string.Join(" ", sponsorable)), |
125 | 126 | helpLinkUri: "https://github.com/devlooped#autosync", |
126 | 127 | "DoesNotSupportF1Help", WellKnownDiagnosticTags.NotConfigurable); |
127 | 128 |
|
128 | 129 | static DiagnosticDescriptor CreateExpired(string[] sponsorable, string prefix) => new( |
129 | 130 | $"{prefix}104", |
130 | | - ThisAssembly.Strings.Expired.Title, |
131 | | - ThisAssembly.Strings.Expired.MessageFormat, |
| 131 | + Resources.Expired_Title, |
| 132 | + Resources.Expired_Message, |
132 | 133 | "SponsorLink", |
133 | 134 | DiagnosticSeverity.Warning, |
134 | 135 | isEnabledByDefault: true, |
135 | | - description: ThisAssembly.Strings.Expired.Description(string.Join(" ", sponsorable)), |
| 136 | + description: string.Format(CultureInfo.CurrentCulture, Resources.Expired_Description, string.Join(" ", sponsorable)), |
136 | 137 | helpLinkUri: "https://github.com/devlooped#autosync", |
137 | 138 | "DoesNotSupportF1Help", WellKnownDiagnosticTags.NotConfigurable); |
138 | 139 | } |
0 commit comments