Skip to content

Commit 867b3e5

Browse files
authored
Fix invalid C# version diagnostic message in config source generator (#94893)
1 parent d2c7d8e commit 867b3e5

File tree

16 files changed

+56
-55
lines changed

16 files changed

+56
-55
lines changed

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Parser/DiagnosticDescriptors.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ private static class DiagnosticDescriptors
3333
public static DiagnosticDescriptor LanguageVersionNotSupported { get; } = DiagnosticDescriptorHelper.Create(
3434
id: "SYSLIB1102",
3535
title: new LocalizableResourceString(nameof(SR.LanguageVersionIsNotSupportedTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
36-
messageFormat: new LocalizableResourceString(nameof(SR.Language_VersionIsNotSupportedMessageFormat), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
36+
messageFormat: new LocalizableResourceString(nameof(SR.LanguageVersionIsNotSupportedMessageFormat), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Configuration.Binder.SourceGeneration.SR)),
3737
category: ProjectName,
3838
defaultSeverity: DiagnosticSeverity.Error,
3939
isEnabledByDefault: true);

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/Strings.resx

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
<?xml version="1.0" encoding="utf-8"?>
22
<root>
3-
<!--
4-
Microsoft ResX Schema
5-
3+
<!--
4+
Microsoft ResX Schema
5+
66
Version 2.0
7-
8-
The primary goals of this format is to allow a simple XML format
9-
that is mostly human readable. The generation and parsing of the
10-
various data types are done through the TypeConverter classes
7+
8+
The primary goals of this format is to allow a simple XML format
9+
that is mostly human readable. The generation and parsing of the
10+
various data types are done through the TypeConverter classes
1111
associated with the data types.
12-
12+
1313
Example:
14-
14+
1515
... ado.net/XML headers & schema ...
1616
<resheader name="resmimetype">text/microsoft-resx</resheader>
1717
<resheader name="version">2.0</resheader>
@@ -26,36 +26,36 @@
2626
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
2727
<comment>This is a comment</comment>
2828
</data>
29-
30-
There are any number of "resheader" rows that contain simple
29+
30+
There are any number of "resheader" rows that contain simple
3131
name/value pairs.
32-
33-
Each data row contains a name, and value. The row also contains a
34-
type or mimetype. Type corresponds to a .NET class that support
35-
text/value conversion through the TypeConverter architecture.
36-
Classes that don't support this are serialized and stored with the
32+
33+
Each data row contains a name, and value. The row also contains a
34+
type or mimetype. Type corresponds to a .NET class that support
35+
text/value conversion through the TypeConverter architecture.
36+
Classes that don't support this are serialized and stored with the
3737
mimetype set.
38-
39-
The mimetype is used for serialized objects, and tells the
40-
ResXResourceReader how to depersist the object. This is currently not
38+
39+
The mimetype is used for serialized objects, and tells the
40+
ResXResourceReader how to depersist the object. This is currently not
4141
extensible. For a given mimetype the value must be set accordingly:
42-
43-
Note - application/x-microsoft.net.object.binary.base64 is the format
44-
that the ResXResourceWriter will generate, however the reader can
42+
43+
Note - application/x-microsoft.net.object.binary.base64 is the format
44+
that the ResXResourceWriter will generate, however the reader can
4545
read any of the formats listed below.
46-
46+
4747
mimetype: application/x-microsoft.net.object.binary.base64
48-
value : The object must be serialized with
48+
value : The object must be serialized with
4949
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
5050
: and then encoded with base64 encoding.
51-
51+
5252
mimetype: application/x-microsoft.net.object.soap.base64
53-
value : The object must be serialized with
53+
value : The object must be serialized with
5454
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
5555
: and then encoded with base64 encoding.
5656
5757
mimetype: application/x-microsoft.net.object.bytearray.base64
58-
value : The object must be serialized into a byte array
58+
value : The object must be serialized into a byte array
5959
: using a System.ComponentModel.TypeConverter
6060
: and then encoded with base64 encoding.
6161
-->
@@ -132,7 +132,7 @@
132132
<data name="ElementTypeNotSupported" xml:space="preserve">
133133
<value>The collection element type is not supported: '{0}'.</value>
134134
</data>
135-
<data name="Language VersionIsNotSupportedMessageFormat" xml:space="preserve">
135+
<data name="LanguageVersionIsNotSupportedMessageFormat" xml:space="preserve">
136136
<value>The project's language version has to be at least 'C# 12'.</value>
137137
</data>
138138
<data name="LanguageVersionIsNotSupportedTitle" xml:space="preserve">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.cs.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Typ elementu kolekce se nepodporuje: {0}“.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">Jazyková verze projektu musí být alespoň C# 11</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.de.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Der Auflistungselementtyp wird nicht unterstützt: "{0}".</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">Die Sprachversion des Projekts muss mindestens „C# 11“ sein</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.es.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">No se admite el tipo de elemento de colección: "{0}".</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">La versión del lenguaje del proyecto debe ser al menos "C# 11".</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.fr.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Le type d‘élément collection n‘est pas pris en charge : ‘{0}‘.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">La version de langage du projet doit être au moins « C# 11 ».</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.it.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Il tipo di elemento della raccolta non è supportato: '{0}'.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">La versione del linguaggio del progetto deve essere almeno 'C# 11'.</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ja.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">コレクション要素型はサポートされていません: '{0}'。</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">プロジェクトの言語バージョンは少なくとも 'C# 11' である必要があります。</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ko.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">컬렉션 요소 유형이 지원되지 않습니다: '{0}'.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">프로젝트의 언어 버전은 'C# 11' 이상이어야 합니다.</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.pl.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Typ elementu kolekcji nie jest obsługiwany: „{0}”.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">Wersja językowa projektu musi mieć wartość co najmniej „C# 11”.</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.pt-BR.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">O tipo de elemento da coleção não é suportado: '{0}'.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">A versão do idioma do projeto deve ser no mínimo 'C# 11'.</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.ru.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Тип элемента коллекции не поддерживается: "{0}".</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">Версия языка проекта должна быть не ниже "C# 11".</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.tr.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">Koleksiyon öğesi türü desteklenmiyor: '{0}'.</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">Projenin dil sürümü en az 'C# 11' olmalıdır.</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.zh-Hans.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">不支持此集合元素类型: '{0}'。</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">项目的语言版本必须至少为 "C# 11"。</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/gen/Resources/xlf/Strings.zh-Hant.xlf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,9 +27,9 @@
2727
<target state="translated">不支援集合元素類型: '{0}'。</target>
2828
<note />
2929
</trans-unit>
30-
<trans-unit id="Language VersionIsNotSupportedMessageFormat">
30+
<trans-unit id="LanguageVersionIsNotSupportedMessageFormat">
3131
<source>The project's language version has to be at least 'C# 12'.</source>
32-
<target state="needs-review-translation">專案的語言版本必須至少為 'C# 11'。</target>
32+
<target state="new">The project's language version has to be at least 'C# 12'.</target>
3333
<note />
3434
</trans-unit>
3535
<trans-unit id="LanguageVersionIsNotSupportedTitle">

src/libraries/Microsoft.Extensions.Configuration.Binder/tests/SourceGenerationTests/GeneratorTests.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ public async Task LangVersionMustBeCharp12OrHigher(LanguageVersion langVersion)
3232

3333
Diagnostic diagnostic = Assert.Single(result.Diagnostics);
3434
Assert.True(diagnostic.Id == "SYSLIB1102");
35+
Assert.Contains("C# 12", diagnostic.Descriptor.MessageFormat.ToString(CultureInfo.InvariantCulture));
3536
Assert.Contains("C# 12", diagnostic.Descriptor.Title.ToString(CultureInfo.InvariantCulture));
3637
Assert.Equal(DiagnosticSeverity.Error, diagnostic.Severity);
3738
}

0 commit comments

Comments
 (0)