From f7df78f4c9b3944d1b937b264601d7b5da55f3ab Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Thu, 17 Aug 2023 16:02:08 -0700 Subject: [PATCH] [release/8.0] Limit language version on Logger and Options source gens (#90709) * Limit language version on Logger and Options source gens * Exclude test in browser * Address the feedback * Fix Json test and apply more feedback * Remove quotes from language versions in source gen diagnostics. (#90720) --------- Co-authored-by: Tarek Mahmoud Sayed Co-authored-by: Eirik Tsarpalis --- docs/project/list-of-diagnostics.md | 10 ++-- .../gen/DiagnosticDescriptors.cs | 8 +++ .../gen/LoggerMessageGenerator.Parser.cs | 7 +++ .../gen/Resources/Strings.resx | 6 ++ .../gen/Resources/xlf/Strings.cs.xlf | 10 ++++ .../gen/Resources/xlf/Strings.de.xlf | 10 ++++ .../gen/Resources/xlf/Strings.es.xlf | 10 ++++ .../gen/Resources/xlf/Strings.fr.xlf | 10 ++++ .../gen/Resources/xlf/Strings.it.xlf | 10 ++++ .../gen/Resources/xlf/Strings.ja.xlf | 10 ++++ .../gen/Resources/xlf/Strings.ko.xlf | 10 ++++ .../gen/Resources/xlf/Strings.pl.xlf | 10 ++++ .../gen/Resources/xlf/Strings.pt-BR.xlf | 10 ++++ .../gen/Resources/xlf/Strings.ru.xlf | 10 ++++ .../gen/Resources/xlf/Strings.tr.xlf | 10 ++++ .../gen/Resources/xlf/Strings.zh-Hans.xlf | 10 ++++ .../gen/Resources/xlf/Strings.zh-Hant.xlf | 10 ++++ .../LoggerMessageGeneratorParserTests.cs | 54 ++++++++++++++++- .../gen/DiagDescriptors.cs | 7 +++ .../Microsoft.Extensions.Options/gen/Parser.cs | 7 +++ .../gen/Resources/Strings.resx | 6 ++ .../gen/Resources/xlf/Strings.cs.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.de.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.es.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.fr.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.it.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.ja.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.ko.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.pl.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.pt-BR.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.ru.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.tr.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.zh-Hans.xlf | 70 ++++++++++++---------- .../gen/Resources/xlf/Strings.zh-Hant.xlf | 70 ++++++++++++---------- .../tests/SourceGeneration.Unit.Tests/Main.cs | 57 ++++++++++++++++++ .../Resources/Strings.resx | 6 ++ .../SourceGenerationTests/Resources/Strings.resx | 6 ++ .../System.Text.Json/gen/Resources/Strings.resx | 56 ++++++++--------- .../gen/Resources/xlf/Strings.cs.xlf | 4 +- .../gen/Resources/xlf/Strings.de.xlf | 4 +- .../gen/Resources/xlf/Strings.es.xlf | 4 +- .../gen/Resources/xlf/Strings.fr.xlf | 4 +- .../gen/Resources/xlf/Strings.it.xlf | 4 +- .../gen/Resources/xlf/Strings.ja.xlf | 4 +- .../gen/Resources/xlf/Strings.ko.xlf | 4 +- .../gen/Resources/xlf/Strings.pl.xlf | 4 +- .../gen/Resources/xlf/Strings.pt-BR.xlf | 4 +- .../gen/Resources/xlf/Strings.ru.xlf | 4 +- .../gen/Resources/xlf/Strings.tr.xlf | 4 +- .../gen/Resources/xlf/Strings.zh-Hans.xlf | 4 +- .../gen/Resources/xlf/Strings.zh-Hant.xlf | 4 +- .../JsonSourceGeneratorDiagnosticsTests.cs | 8 +-- 52 files changed, 876 insertions(+), 454 deletions(-) diff --git a/docs/project/list-of-diagnostics.md b/docs/project/list-of-diagnostics.md index 4f78e9e..75d2522 100644 --- a/docs/project/list-of-diagnostics.md +++ b/docs/project/list-of-diagnostics.md @@ -142,10 +142,10 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1023`__ | Generating more than 6 arguments is not supported | | __`SYSLIB1024`__ | Argument is using the unsupported out parameter modifier | | __`SYSLIB1025`__ | Multiple logging methods cannot use the same event name within a class | -| __`SYSLIB1026`__ | _`SYSLIB1026`-`SYSLIB1029` reserved for logging._ | -| __`SYSLIB1027`__ | _`SYSLIB1026`-`SYSLIB1029` reserved for logging._ | -| __`SYSLIB1028`__ | _`SYSLIB1026`-`SYSLIB1029` reserved for logging._ | -| __`SYSLIB1029`__ | _`SYSLIB1026`-`SYSLIB1029` reserved for logging._ | +| __`SYSLIB1026`__ | C# language version not supported by the logging source generator. | +| __`SYSLIB1027`__ | _`SYSLIB1001`-`SYSLIB1029` reserved for logging._ | +| __`SYSLIB1028`__ | _`SYSLIB1001`-`SYSLIB1029` reserved for logging._ | +| __`SYSLIB1029`__ | _`SYSLIB1001`-`SYSLIB1029` reserved for logging._ | | __`SYSLIB1030`__ | JsonSourceGenerator did not generate serialization metadata for type | | __`SYSLIB1031`__ | JsonSourceGenerator encountered a duplicate JsonTypeInfo property name | | __`SYSLIB1032`__ | JsonSourceGenerator encountered a context class that is not partial | @@ -250,7 +250,7 @@ The diagnostic id values reserved for .NET Libraries analyzer warnings are `SYSL | __`SYSLIB1213`__ | Options validation generator: Member potentially missing enumerable validation. | | __`SYSLIB1214`__ | Options validation generator: Can't validate constants, static fields or properties. | | __`SYSLIB1215`__ | Options validation generator: Validation attribute on the member is inaccessible from the validator type. | -| __`SYSLIB1216`__ | *_`SYSLIB1201`-`SYSLIB1219` reserved for Microsoft.Extensions.Options.SourceGeneration.* | +| __`SYSLIB1216`__ | C# language version not supported by the options validation source generator. | | __`SYSLIB1217`__ | *_`SYSLIB1201`-`SYSLIB1219` reserved for Microsoft.Extensions.Options.SourceGeneration.* | | __`SYSLIB1218`__ | *_`SYSLIB1201`-`SYSLIB1219` reserved for Microsoft.Extensions.Options.SourceGeneration.* | | __`SYSLIB1219`__ | *_`SYSLIB1201`-`SYSLIB1219` reserved for Microsoft.Extensions.Options.SourceGeneration.* | diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/DiagnosticDescriptors.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/DiagnosticDescriptors.cs index ed51ed6..ec89ae4 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/DiagnosticDescriptors.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/DiagnosticDescriptors.cs @@ -200,5 +200,13 @@ namespace Microsoft.Extensions.Logging.Generators category: "LoggingGenerator", DiagnosticSeverity.Warning, isEnabledByDefault: true); + + public static DiagnosticDescriptor LoggingUnsupportedLanguageVersion { get; } = new DiagnosticDescriptor( + id: "SYSLIB1026", + title: new LocalizableResourceString(nameof(SR.LoggingUnsupportedLanguageVersionTitle), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)), + messageFormat: new LocalizableResourceString(nameof(SR.LoggingUnsupportedLanguageVersionMessageFormat), SR.ResourceManager, typeof(FxResources.Microsoft.Extensions.Logging.Generators.SR)), + category: "LoggingGenerator", + defaultSeverity: DiagnosticSeverity.Error, + isEnabledByDefault: true); } } diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.Parser.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.Parser.cs index 2b5b8ca..038b71b 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.Parser.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/LoggerMessageGenerator.Parser.cs @@ -591,6 +591,13 @@ namespace Microsoft.Extensions.Logging.Generators } } + if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) + { + // we only support C# 8.0 and above + Diag(DiagnosticDescriptors.LoggingUnsupportedLanguageVersion, null, version.ToDisplayString(), LanguageVersion.CSharp8.ToDisplayString()); + return Array.Empty(); + } + return results; } diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/Strings.resx index 529263f..602e6f4 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/Strings.resx +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/Strings.resx @@ -231,4 +231,10 @@ Logging method contains malformed format strings + + C# language version not supported by the source generator. + + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.cs.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.cs.xlf index ac5ddc0..00e8b1c 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.cs.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.cs.xlf @@ -67,6 +67,16 @@ Metody protokolování musí být statické. + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings Metoda protokolování {0} obsahuje řetězce s poškozeným formátem. diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.de.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.de.xlf index c57008e..2e962cd 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.de.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.de.xlf @@ -67,6 +67,16 @@ Protokollierungsmethoden müssen statisch sein. + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings Die Protokollierungsmethode „{0}“ enthält nicht wohlgeformte Formatzeichenfolgen. diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.es.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.es.xlf index 29cce5c..46073f1 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.es.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.es.xlf @@ -67,6 +67,16 @@ Los métodos de registro deben ser estáticos + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings El método de registro “{0}” contiene cadenas con formato incorrecto diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.fr.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.fr.xlf index afd2c18..2497ea1 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.fr.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.fr.xlf @@ -67,6 +67,16 @@ Les méthodes de journalisation doivent être statiques + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings La méthode de journalisation « {0} »contient des chaînes de format incorrectes diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.it.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.it.xlf index 99b2e81..06dadff 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.it.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.it.xlf @@ -67,6 +67,16 @@ I metodi di registrazione devono essere statici + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings Il metodo di registrazione '{0}' contiene stringhe in formato non valido diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ja.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ja.xlf index a8c7939..bd03905 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ja.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ja.xlf @@ -67,6 +67,16 @@ ログ メソッドは静的である必要があります + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings ログ メソッド '{0}' に、形式の正しくない文字列が含まれています diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ko.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ko.xlf index 0b77d9c..eea8ef2 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ko.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ko.xlf @@ -67,6 +67,16 @@ 로깅 메서드는 정적이어야 함 + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings 로깅 메서드 '{0}'에 잘못된 형식의 문자열이 포함되어 있습니다. diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pl.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pl.xlf index 2784dfa..6dbecb8 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pl.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pl.xlf @@ -67,6 +67,16 @@ Metody rejestrowania muszą być statyczne + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings Metoda rejestrowania „{0}” zawiera źle sformułowane ciągi formatu diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pt-BR.xlf index 22b9fab..f7de3a3 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pt-BR.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.pt-BR.xlf @@ -67,6 +67,16 @@ Os métodos de registro em log devem ser estáticos + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings O método de registro '{0}' contém strings de formato malformado diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ru.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ru.xlf index 4446666..9599e0f 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ru.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.ru.xlf @@ -67,6 +67,16 @@ Методы ведения журнала должны быть статическими + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings Метод ведения журнала событий "{0}" содержит строки неправильного формата diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.tr.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.tr.xlf index fb21d7e..529a109 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.tr.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.tr.xlf @@ -67,6 +67,16 @@ Günlüğe kaydetme yöntemleri statik olmalıdır + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings '{0}' günlüğe kaydetme yöntemi hatalı biçimlendirilmiş biçim dizeleri içeriyor diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hans.xlf index 021f321..879c6a7 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hans.xlf @@ -67,6 +67,16 @@ 日志记录方法必须为静态方法 + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings 日志记录方法“{0}”包含格式错误的字符串 diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hant.xlf index c50c705..42061ca 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/gen/Resources/xlf/Strings.zh-Hant.xlf @@ -67,6 +67,16 @@ 記錄方法必須是靜態 + + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + The Logging source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. + + Logging method '{0}' contains malformed format strings 記錄方法 '{0}' 包含格式錯誤的格式字串 diff --git a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs index 462111a..dc677e8 100644 --- a/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs +++ b/src/libraries/Microsoft.Extensions.Logging.Abstractions/tests/Microsoft.Extensions.Logging.Generators.Tests/LoggerMessageGeneratorParserTests.cs @@ -4,10 +4,12 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; +using System.Linq; using System.Reflection; using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis; +using Microsoft.CodeAnalysis.CSharp; using SourceGenerators.Tests; using Xunit; @@ -108,7 +110,7 @@ namespace Microsoft.Extensions.Logging.Generators.Tests {{ [LoggerMessage({argumentList})] static partial void M1(ILogger logger, string foo); - + [LoggerMessage({argumentList})] static partial void M2(ILogger logger, LogLevel level, string foo); }} @@ -911,6 +913,56 @@ namespace Microsoft.Extensions.Logging.Generators.Tests Assert.Equal(DiagnosticDescriptors.LoggingMethodHasBody.Id, diagnostics[0].Id); } + [Fact] + public async Task LanguageVersionTest() + { + string source = """ + using Microsoft.Extensions.Logging; + + internal partial class Program + { + static void Main() { } + + [LoggerMessage( + EventId = 0, + Level = LogLevel.Critical, + Message = "Could not open socket to `{hostName}`")] + static partial void CouldNotOpenSocket(ILogger logger, string hostName); + } + """; + + Assembly[]? refs = new[] { typeof(ILogger).Assembly, typeof(LoggerMessageAttribute).Assembly }; + + // Run the generator with C# 7.0 and verify that it fails. + var (diagnostics, generatedSources) = await RoslynTestUtils.RunGenerator( + new LoggerMessageGenerator(), refs, new[] { source }, includeBaseReferences: true, LanguageVersion.CSharp7).ConfigureAwait(false); + + Assert.NotEmpty(diagnostics); + Assert.Equal("SYSLIB1026", diagnostics[0].Id); + Assert.Empty(generatedSources); + + // Run the generator with C# 8.0 and verify that it succeeds. + (diagnostics, generatedSources) = await RoslynTestUtils.RunGenerator( + new LoggerMessageGenerator(), refs, new[] { source }, includeBaseReferences: true, LanguageVersion.CSharp8).ConfigureAwait(false); + + Assert.Empty(diagnostics); + Assert.Single(generatedSources); + + // Compile the generated code with C# 7.0 and verify that it fails. + CSharpParseOptions parseOptions = new CSharpParseOptions(LanguageVersion.CSharp7); + SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedSources[0].SourceText.ToString(), parseOptions); + var diags = syntaxTree.GetDiagnostics().ToArray(); + Assert.Equal(1, diags.Length); + // error CS8107: Feature 'nullable reference types' is not available in C# 7.0. Please use language version 8.0 or greater. + Assert.Equal("CS8107", diags[0].Id); + + // Compile the generated code with C# 8.0 and verify that it succeeds. + parseOptions = new CSharpParseOptions(LanguageVersion.CSharp8); + syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedSources[0].SourceText.ToString(), parseOptions); + diags = syntaxTree.GetDiagnostics().ToArray(); + Assert.Equal(0, diags.Length); + } + private static async Task> RunGenerator( string code, bool wrap = true, diff --git a/src/libraries/Microsoft.Extensions.Options/gen/DiagDescriptors.cs b/src/libraries/Microsoft.Extensions.Options/gen/DiagDescriptors.cs index 4746861..141fc6b 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/DiagDescriptors.cs +++ b/src/libraries/Microsoft.Extensions.Options/gen/DiagDescriptors.cs @@ -105,5 +105,12 @@ namespace Microsoft.Extensions.Options.Generators messageFormat: SR.InaccessibleValidationAttributeMessage, category: Category, defaultSeverity: DiagnosticSeverity.Info); + + public static DiagnosticDescriptor OptionsUnsupportedLanguageVersion { get; } = Make( + id: "SYSLIB1216", + title: SR.OptionsUnsupportedLanguageVersionTitle, + messageFormat: SR.OptionsUnsupportedLanguageVersionMessage, + category: Category, + defaultSeverity: DiagnosticSeverity.Error); } } diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Parser.cs b/src/libraries/Microsoft.Extensions.Options/gen/Parser.cs index 07ea7de..0c8e216 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Parser.cs +++ b/src/libraries/Microsoft.Extensions.Options/gen/Parser.cs @@ -143,6 +143,13 @@ namespace Microsoft.Extensions.Options.Generators results.AddRange(_synthesizedValidators.Values); _synthesizedValidators.Clear(); + if (results.Count > 0 && _compilation is CSharpCompilation { LanguageVersion : LanguageVersion version and < LanguageVersion.CSharp8 }) + { + // we only support C# 8.0 and above + Diag(DiagDescriptors.OptionsUnsupportedLanguageVersion, null, version.ToDisplayString(), LanguageVersion.CSharp8.ToDisplayString()); + return new List(); + } + return results; } diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Options/gen/Resources/Strings.resx index ef074f1..6293431 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/Strings.resx +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/Strings.resx @@ -207,4 +207,10 @@ Validation attribute on the member is inaccessible from the validator type.. + + C# language version not supported by the source generator. + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.cs.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.cs.xlf index fadfdec..7054599 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.cs.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.cs.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Typ {0} již implementuje metodu Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Typ už obsahuje implementaci metody Validate. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] nelze použít pro statickou třídu {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - OptionsValidatorAttribute nelze použít pro statickou třídu. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - U polí nebo vlastností s otevřeným obecným typem {0} nelze použít [ValidateObjectMembers] nebo [ValidateEnumeratedItems]. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - U polí nebo vlastností s otevřenými obecnými typy nelze použít ValidateObjectMembersAttribute nebo ValidateEnumeratedItemsAttribute. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Atributy ověřování nelze použít u konstantního ani statického člena {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Nelze ověřit konstanty, statická pole ani vlastnosti. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Existuje cyklický odkaz obsahující typ {0}, který brání jeho použití pro statické ověření. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Nepodporované cyklické odkazy v typech modelů. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Typ {0} neimplementuje požadované rozhraní IValidateOptions<{1}> . + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Typ anotovaný třídou OptionsValidatorAttribute neimplementuje nezbytné rozhraní. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - Ověřovací atribut „{0}“ u člena „{1}“ není přístupný z typu validátoru „{2}“. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - Ověřovací atribut u člena není přístupný z typu validátoru. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Ověřovací atributy nelze použít u privátního pole nebo vlastnosti {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Nelze ověřit privátní pole nebo vlastnosti. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Typ {0} nemá žádná pole ani vlastnosti k ověření, na které odkazuje člen {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Typ člena nemá žádná pole ani vlastnosti k ověření. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Typ {0} nemá žádná pole ani vlastnosti k ověření, na které odkazuje typ {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Typ nemá žádná pole ani vlastnosti k ověření. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] nelze použít u členů typu {0}, protože neimplementuje rozhraní IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Typ členu není výčtový. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Typ validátoru s hodnotou null zadaný v atributech [ValidateObjectMembers] nebo [ValidateEnumeratedItems]. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Pro atributy ValidateObjectMembersAttribute nebo ValidateEnumeratedItemsAttribute byl specifikovaný typ validátoru s hodnotou null. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Typ {0} obsahuje validační anotace, ale člen {1} neurčuje [ValidateEnumeratedItems], což může být přehlédnutí. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - U člena potenciálně chybí ověření výčtu. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Typ {0} obsahuje validační anotace, ale člen {1} neurčuje [ValidateObjectMembers], což může být přehlédnutí. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - U člena potenciálně chybí přenositelné ověření. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Typ validátoru {0} nemá konstruktor bez parametrů. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Validátory používané pro přenositelné nebo výčtové ověřování musí mít konstruktor bez parametrů. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.de.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.de.xlf index badb961..5f6febb 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.de.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.de.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Der Typ "{0}" implementiert bereits die Validate-Methode. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Ein Typ enthält bereits eine Implementierung der Validate-Methode. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] kann nicht auf die statische Klasse "{0}" angewendet werden. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - "OptionsValidatorAttribute" kann nicht auf eine statische Klasse angewendet werden. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - "ValidateObjectMembers" oder "ValidateEnumeratedItems" kann nicht für Felder oder Eigenschaften mit offenem generischen Typ {0} verwendet werden. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - "ValidateObjectMembersAttribute" oder "ValidateEnumeratedItemsAttribute" kann nicht für Felder oder Eigenschaften mit offenen generischen Typen verwendet werden. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Validierungsattribute können nicht auf konstanten oder statischen Member {0} angewendet werden. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Konstanten, statische Felder oder Eigenschaften können nicht überprüft werden. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Es gibt einen Zirkelverweis, der den Typ "{0}" verhindert, dass er für die statische Validierung verwendet wird. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Nicht unterstützte Zirkelverweise in Modelltypen. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Der Typ "{0}" implementiert nicht die erforderliche IValidateOptions<{1}>-Schnittstelle. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Ein mit "OptionsValidatorAttribute" versehener Typ implementiert nicht die erforderliche Schnittstelle. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - Auf das Validierungsattribut "{0}" für den Member "{1}" kann vom Validierungssteuerelementtyp "{2}" nicht zugegriffen werden. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - Auf das Validierungsattribut für den Member kann vom Validierungssteuerelementtyp nicht zugegriffen werden. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Validierungsattribute können nicht auf private Felder oder Eigenschaften {0} angewendet werden. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Private Felder oder Eigenschaften können nicht überprüft werden. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Der Typ "{0}" weist keine zu überprüfenden Felder oder Eigenschaften auf, auf die von Member "{1}" verwiesen wird. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Ein Membertyp weist keine zu überprüfenden Felder oder Eigenschaften auf. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Der Typ "{0}" weist keine zu überprüfenden Felder oder Eigenschaften auf, auf die vom Typ "{1}" verwiesen wird. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Ein Typ weist keine zu überprüfenden Felder oder Eigenschaften auf. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] kann nicht für Member vom Typ "{0}" verwendet werden, da es IEnumerable<T> nicht implementiert. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Der Membertyp ist nicht aufzählbar. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Der in den Attributen [ValidateObjectMembers] oder [ValidateEnumeratedItems] angegebene NULL-Validierungssteuerelementtyp. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Für die Attribute "ValidateObjectMembersAttribute" oder "ValidateEnumeratedItemsAttribute" wurde ein NULL-Validierungssteuerelementtyp angegeben. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Der Typ "{0}" weist Validierungsanmerkungen auf, der Member "{1}" gibt jedoch keine [ValidateEnumeratedItems] an, die eine Vorhersage darstellen könnten. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Dem Mitglied fehlt möglicherweise eine aufzählbare Validierung. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Der Typ "{0}" weist Validierungsanmerkungen auf, aber Member "{1}" gibt [ValidateObjectMembers] nicht an, was ein Versehen sein könnte. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Dem Member fehlt möglicherweise die transitive Validierung. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Der Validierungssteuerelementtyp "{0}" hat keinen parameterlosen Konstruktor. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Validierungssteuerelemente, die für die transitive oder enumerierbare Validierung verwendet werden, müssen über einen Konstruktor ohne Parameter verfügen. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.es.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.es.xlf index 9637c745..84c12b9 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.es.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.es.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - El tipo {0} ya implementa el método Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Un tipo ya incluye una implementación del método “Validate”. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - No se puede aplicar [OptionsValidator] a la clase estática {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - “OptionsValidatorAttribute” no se puede aplicar a una clase estática. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - No se puede usar [ValidateObjectMembers] ni [ValidateEnumeratedItems] en campos o propiedades con tipos genéricos abiertos {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - No se puede usar “ValidateObjectMembersAttribute” o “ValidateEnumeratedItemsAttribute” en campos o propiedades con tipos genéricos abiertos. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - No se pueden aplicar atributos de validación a un miembro {0}constante o estático. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - No se pueden validar constantes, campos estáticos ni propiedades. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Hay una referencia de tipo circular que implica al tipo {0} que impide que se use para la validación estática. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Referencias circulares no admitidas en los tipos de modelo. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - El tipo {0} no implementa la interfaz IValidateOptions<{1}> necesaria. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Un tipo anotado con “OptionsValidatorAttribute” no implementa la interfaz necesaria. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - No se puede obtener acceso al atributo de validación '{0}' en el miembro '{1}' desde el tipo de validador '{2}'. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - No se puede obtener acceso al atributo de validación en el miembro desde el tipo de validador. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - No se pueden aplicar atributos de validación a la propiedad o campo privado {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - No se pueden validar los campos o propiedades privadas. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - El tipo {0} no tiene campos ni propiedades para validar, al que hace referencia el tipo {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Un tipo de miembro no tiene campos ni propiedades para validar. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - El tipo {0} no tiene campos ni propiedades para validar, al que hace referencia el tipo {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Un tipo no tiene campos ni propiedades para validar. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] no se puede usar en miembros de tipo {0} porque no implementa IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - El tipo de miembro no es enumerable. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Se especificó un tipo de validador nulo en los atributos [ValidateObjectMembers] o [ValidateEnumeratedItems]. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Se especificó un tipo de validador nulo para los atributos “ValidateObjectMembersAttribute” o “ValidateEnumeratedItemsAttribute”. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - El tipo {0} tiene anotaciones de validación, pero el miembro {1} no especifica [ValidateEnumeratedItems], lo que podría ser un error. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Posiblemente falta la validación enumerable en el miembro. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - El tipo {0} tiene anotaciones de validación, pero el miembro {1} no especifica [ValidateObjectMembers], lo que podría ser un error. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Posiblemente falta la validación transitiva en el miembro. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - El tipo de validador {0} no tiene un constructor sin parámetros. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Los validadores usados para la validación transitiva o enumerable deben tener un constructor sin parámetros. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.fr.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.fr.xlf index 93817f5..58a27f1 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.fr.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.fr.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Le type {0} implémente déjà la méthode Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Un type inclut déjà une implémentation de la méthode 'Validate'. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] ne peut pas être appliqué à la classe statique {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 'OptionsValidatorAttribute' ne peut pas être appliqué à une classe statique. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - Impossible d’utiliser [ValidateObjectMembers] ou [ValidateEnumeratedItems] sur des champs ou des propriétés avec un type générique ouvert {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Impossible d’utiliser 'ValidateObjectMembersAttribute' ou 'ValidateEnumeratedItemsAttribute' sur des champs ou des propriétés avec des types génériques ouverts. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Impossible d’appliquer les attributs de validation au membre constant ou statique {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Impossible de valider les constantes, les champs statiques ou les propriétés. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Une référence de type circulaire implique un type {0} l’empêche d’être utilisé pour la validation statique. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Références circulaires non prises en charge dans les types de modèle. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Le type {0} n’implémente pas l’interface<{1}> IValidateOptions requise. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Un type annoté avec 'OptionsValidatorAttribute' n’implémente pas l’interface nécessaire. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - L’attribut de validation '{0}' sur le membre '{1}' n’est pas accessible à partir du type de validateur '{2}'. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - L’attribut de validation sur le membre n’est pas accessible à partir du type de validateur. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Impossible d’appliquer les attributs de validation au champ privé ou à la propriété {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Impossible de valider les champs ou propriétés privés. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Le type {0} n’a aucun champ ou propriété à valider, référencé à partir du membre {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Un type de membre n’a aucun champ ou propriété à valider. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Le type {0} n’a pas de champs ou de propriétés à valider, référencé par type {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Un type n’a pas de champs ou de propriétés à valider. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] ne peut pas être utilisé sur des membres de type {0}, car il n’implémente pas IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Le type de membre n’est pas énumérable. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Type de validateur Null spécifié dans les attributs [ValidateObjectMembers] ou [ValidateEnumeratedItems]. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Type de validateur Null spécifié pour les attributs 'ValidateObjectMembersAttribute' ou 'ValidateEnumeratedItemsAttribute'. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Le type {0} a des annotations de validation, mais le membre {1} ne spécifie pas [ValidateEnumeratedItems] qui peut être une supervision. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Le membre n’a peut-être pas de validation énumérable. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Le type {0} a des annotations de validation, mais le membre {1} ne spécifie pas [ValidateObjectMembers] qui pourrait être une méthode de récupération. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Le membre n’a peut-être pas de validation transitive. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Le type de validateur {0} n’a pas de constructeur sans paramètre. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Les validateurs utilisés pour la validation transitive ou énumérable doivent avoir un constructeur sans paramètres. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.it.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.it.xlf index b80d8e2..2355a93 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.it.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.it.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Il tipo {0} implementa già il metodo Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Un tipo include già un'implementazione del metodo 'Validate'. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - impossibile applicare [OptionsValidator] alla classe statica {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 'OptionsValidatorAttribute' non può essere applicato a una classe statica. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - Non è possibile usare [ValidateObjectMembers] o [ValidateEnumeratedItems] in campi o proprietà con tipo generico aperto {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Non è possibile usare 'ValidateObjectMembersAttribute' o 'ValidateEnumeratedItemsAttribute' nei campi o nelle proprietà con tipi generici aperti. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Non è possibile applicare attributi di convalida a un membro costante o statico {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Non è possibile convalidare costanti, campi statici o proprietà. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Esiste un riferimento di tipo circolare che interessa il tipo {0} e ne impedisce l'utilizzo per la convalida statica. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Riferimenti circolari non supportati nei tipi di modello. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Il tipo {0} non implementa l'interfaccia IValidateOptions<{1}> richiesta. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Un tipo annotato con 'OptionsValidatorAttribute' non implementa l'interfaccia necessaria. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - L'attributo di convalida '{0}' nel membro '{1}' non è accessibile dal tipo di validator '{2}'. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - L'attributo di convalida nel membro non è accessibile dal tipo di validator. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Non è possibile applicare gli attributi di convalida al campo privato o alla proprietà {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Non è possibile convalidare proprietà o campi privati. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Il tipo {0} non contiene campi o proprietà da convalidare, riferiti dal membro {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Un tipo di membro non contiene campi o proprietà da convalidare. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Il tipo {0} non contiene campi o proprietà da convalidare, riferiti per tipo {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Un tipo non contiene campi o proprietà da convalidare. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] non può essere usato nei membri di tipo {0} perché non implementa IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Il tipo di membro non è enumerabile. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Tipo di validator Null specificato negli attributi [ValidateObjectMembers] o [ValidateEnumeratedItems]. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Tipo di validator Null specificato per gli attributi 'ValidateObjectMembersAttribute' o 'ValidateEnumeratedItemsAttribute'. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Il tipo {0} include annotazioni di convalida, ma il membro {1} non specifica [ValidateEnumeratedItems] che potrebbe essere una supervisione. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Convalida enumerabile potenzialmente mancante nel membro. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Il tipo {0} include annotazioni di convalida, ma il membro {1} non specifica [ValidateObjectMembers] che potrebbe essere una supervisione. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Il membro potrebbe non avere una convalida transitiva. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Il tipo di convalida {0} non dispone di un costruttore senza parametri. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - I convalidatori usati per la convalida transitiva o enumerabile devono avere un costruttore senza parametri. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ja.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ja.xlf index b9b44dd..60e9a7d 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ja.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ja.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - 型 {0} に Validate メソッドが既に実装されています。 + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - 型には 'Validate' メソッドの実装が既に含まれています。 + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - 静的クラス {0} には [OptionsValidator] を適用できません。 + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 'OptionsValidatorAttribute' は静的クラスに適用できません。 + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - [ValidateObjectMembers] または [ValidateEnumeratedItems] は、オープンジェネリック型 {0} を持つフィールドまたはプロパティでは使用できません。 + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - 'ValidateObjectMembersAttribute' または 'ValidateEnumeratedItemsAttribute' は、オープンジェネリック型を持つフィールドまたはプロパティでは使用できません。 + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - 定数または静的メンバー {0} に検証属性を適用できません。 + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - 定数、静的フィールド、またはプロパティを検証できません。 + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - 型{0}を含む循環型参照があるため、静的検証に使用できません。 + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - モデル型でサポートされていない循環参照です。 + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - 必要な IValidateOptions<{1}> インターフェイスが型 {0} に実装されていません。 + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - 'OptionsValidatorAttribute' の注釈が付けられた型が、必要とされるインターフェイスを実装していません。 + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - メンバー '{0}' の検証属性 '{1}' は、検証コントロールの種類 '{2}'からアクセスできません。 + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - メンバーの検証属性は、検証コントロールの種類からアクセスできません... + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - プライベート フィールドまたはプロパティ {0} には検証属性を適用できません。 + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - プライベート フィールドまたはプロパティを検証できません。 + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - 型 {0} にメンバー {1} から参照されている検証対象のフィールドまたはプロパティがありません。 + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - メンバー型に検証対象のフィールドまたはプロパティがありません。 + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - 型 {0} に型 {1} で参照されている検証対象のフィールドまたはプロパティがありません。 + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - 型に検証対象のフィールドまたはプロパティがありません。 + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] は IEnumerable<T> を実装していないため、型 {0} のメンバーでは使用できません。 + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - メンバー型は列挙型ではありません。 + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - [ValidateObjectMembers] 属性または [ValidateEnumeratedItems] 属性で null のバリデーター型が指定されています。 + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - 'ValidateObjectMembersAttribute' 属性または 'ValidateEnumeratedItemsAttribute' 属性に対して NULL のバリデーター型が指定されています。 + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - 型 {0} には検証の注釈がありますが、メンバー {1} では [ValidateEnumeratedItem] が指定されていません。これは誤りである可能性があります。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - 列挙型の検証がメンバーに存在しない可能性があります。 + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - 型 {0} には検証の注釈がありますが、メンバー {1} では [ValidateObjectMembers] が指定されていません。これは誤りである可能性があります。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - メンバーに推移性の検証がない可能性があります。 + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - バリデーター型 {0} にパラメーターなしのコンストラクターがありません。 + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - 推移性または列挙型の検証に使用されるバリデーターには、パラメーターのないコンストラクターが必要です。 + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ko.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ko.xlf index 45819c9..e350b2f 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ko.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ko.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - 형식 {0}은(는) Validate 메서드를 이미 구현하고 있습니다. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - 형식에 'Validate' 메서드 구현이 이미 포함되어 있습니다. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator]은(는) 정적 클래스 {0}에 적용할 수 없습니다. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 'OptionsValidatorAttribute'는 정적 클래스에 적용할 수 없습니다. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - 열린 제네릭 형식 {0}의 필드 또는 속성에는 [ValidateObjectMembers] 또는 [ValidateEnumeratedItems]을(를) 사용할 수 없습니다. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - 열린 제네릭 형식의 필드 또는 속성에는 'ValidateObjectMembersAttribute' 또는 'ValidateEnumeratedItemsAttribute'를 사용할 수 없습니다. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - 상수 또는 정적 멤버 {0}에 유효성 검사 특성을 적용할 수 없습니다. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - 상수, 정적 필드 또는 속성을 확인할 수 없습니다. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - 정적 유효성 검사에 사용할 수 없으므로 형식 {0} 관련된 순환 형식 참조가 있습니다. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - 모델 형식에 지원되지 않는 순환 참조가 있습니다. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - 형식 {0}은(는) 필요한 IValidateOptions<{1}> 인터페이스를 구현하지 않습니다. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - 'OptionsValidatorAttribute'로 주석이 추가된 형식은 필요한 인터페이스를 구현하지 않습니다. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - 유효성 검사기 유형 '{2}'에서 '{1}' 멤버의 '{0}' 유효성 검사 특성에 액세스할 수 없습니다. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - 유효성 검사기 유형에서 멤버의 유효성 검사 특성에 액세스할 수 없습니다. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - 프라이빗 필드 또는 속성 {0}에 유효성 검사 특성을 적용할 수 없습니다. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - 프라이빗 필드 또는 속성의 유효성을 검사할 수 없습니다. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - 형식 {0}은(는) 유효성을 검사할 필드 또는 속성이 없으므로 멤버 {1}을(를) 참조합니다. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - 멤버 형식에 유효성을 검사할 필드 또는 속성이 없습니다. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - 형식 {0}은(는) 유효성을 검사할 필드 또는 속성이 없으므로 형식 {1}을(를) 참조합니다. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - 형식에 유효성을 검사할 필드 또는 속성이 없습니다. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems]은(는) IEnumerable<T>을(를) 구현하지 않으므로 형식 {0}의 멤버에 사용할 수 없습니다. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - 멤버 형식을 열거할 수 없습니다. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - [ValidateObjectMembers] 또는 [ValidateEnumeratedItems] 특성에 Null 유효성 검사기 형식이 지정되었습니다. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - 'ValidateObjectMembersAttribute' 또는 'ValidateEnumeratedItemsAttribute' 특성에 Null 유효성 검사기 형식이 지정되었습니다. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - 형식 {0}은(는) 유효성 검사 주석이 있지만 멤버 {1}은(는) 참조할 수 있는 [ValidateEnumeratedItems]을(를) 지정하지 않습니다. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - 멤버에 열거 가능한 유효성 검사가 누락되었을 수 있습니다. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - 형식 {0}은(는) 유효성 검사 주석이 있지만 멤버 {1}은(는) 참조할 수 있는 [ValidateObjectMembers]을(를) 지정하지 않습니다. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - 멤버에 전이적 유효성 검사가 누락되었을 수 있습니다. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - 유효성 검사기 형식 {0}은(는) 매개 변수가 없는 생성자가 없습니다. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - 전이적 또는 열거형 유효성 검사에 사용되는 유효성 검사기에는 매개 변수가 없는 생성자가 있어야 합니다. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pl.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pl.xlf index 0b57a0a..edaf8b9 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pl.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pl.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Typ {0} już implementuje metodę Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Typ zawiera już implementację metody „Validate”. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - Nie można zastosować elementu [OptionsValidator] do klasy statycznej {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - Nie można zastosować elementu „OptionsValidatorAttribute” do klasy statycznej. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - Nie można użyć atrybutu [ValidateObjectMembers] lub [ValidateEnumeratedItems] w polach lub właściwościach z otwartymi typami ogólnymi {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Nie można użyć atrybutu „ValidateObjectMembersAttribute” lub „ValidateEnumeratedItemsAttribute” w polach lub właściwościach z otwartymi typami ogólnymi. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Nie można zastosować atrybutów walidacji do stałych lub statycznych elementów członkowskich {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Nie można zweryfikować stałych, pól statycznych lub właściwości. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Istnieje cykliczne odwołanie do typu dotyczące typu {0} uniemożliwiające użycie go do weryfikacji statycznej. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Nieobsługiwane odwołania cykliczne w typach modeli. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Typ {0} nie implementuje wymaganego interfejsu IValidateOptions<{1}>. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Typ z adnotacją „OptionsValidatorAttribute” nie implementuje wymaganego interfejsu. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - Atrybut walidacji „{0}” elementu członkowskiego „{1}” jest niedostępny z typu modułu sprawdzania poprawności „{2}”. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - Atrybut walidacji elementu członkowskiego jest niedostępny z typu modułu sprawdzania poprawności. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Nie można zastosować atrybutów weryfikacji do pola prywatnego lub właściwości {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Nie można zweryfikować prywatnych pól lub właściwości. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Typ {0} nie ma pól ani właściwości do zweryfikowania, do których odwołuje się element członkowski {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Typ elementu członkowskiego nie ma pól ani właściwości do zweryfikowania. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Typ {0} nie ma pól ani właściwości do zweryfikowania, do których odwołuje się typ {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Typ nie ma pól ani właściwości do zweryfikowania. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - Atrybutu [ValidateEnumeratedItems] nie można używać w przypadku elementów członkowskich typu {0}, ponieważ nie implementuje interfejsu IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Nie można wyliczyć typu elementu członkowskiego. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - W atrybutach [ValidateObjectMembers] lub [ValidateEnumeratedItems] określono typ modułu sprawdzania poprawności o wartości null. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Określono typ modułu sprawdzania poprawności o wartości null dla atrybutu „ValidateObjectMembersAttribute” lub „ValidateEnumeratedItemsAttribute”. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Typ {0} ma adnotacje walidacji, ale element członkowski {1} nie określa atrybutu [ValidateEnumeratedItems], co może być przeoczeniem. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - W elemencie członkowskim może brakować walidacji możliwej do wyliczenia. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Typ {0} ma adnotacje walidacji, ale element członkowski {1} nie określa atrybutu [ValidateObjectMembers], co może być przeoczeniem. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - W przypadku elementu członkowskiego może potencjalnie brakować weryfikacji przechodniej. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Typ modułu sprawdzania poprawności {0} nie ma konstruktora bez parametrów. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Moduły sprawdzania poprawności używane do weryfikacji przechodniej lub weryfikacji możliwej do wyliczenia muszą mieć konstruktora bez żadnych parametrów. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pt-BR.xlf index 4afa1d6..f62a1ef 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pt-BR.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.pt-BR.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - O tipo {0} já implementa o método Validar. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Um tipo já inclui uma implementação do método "Validar". + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] não pode ser aplicado à classe estática {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - "OptionsValidatorAttribute" não pode ser aplicado a uma classe estática. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - Não é possível usar [ValidateObjectMembers] ou [ValidateEnumeratedItems] em campos ou propriedades com o tipo genérico aberto {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Não é possível usar "ValidateObjectMembersAttribute" ou "ValidateEnumeratedItemsAttribute" em campos ou propriedades com tipos genéricos abertos. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Não é possível aplicar atributos de validação a um membro constante ou estático {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Não é possível validar constantes, campos estáticos ou propriedades. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Há uma referência de tipo circular que envolve o tipo {0} que a impede de ser usada para validação estática. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Referências circulares sem suporte em tipos de modelo. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - O tipo {0} não implementa a interface IValidateOptions<{1}> necessária. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Um tipo anotado com "OptionsValidatorAttribute" não implementa a interface necessária. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - O atributo de validação '{0}' no membro '{1}' está inacessível do tipo de validador '{2}'. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - O atributo de validação no membro está inacessível do tipo de validador. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Não é possível aplicar atributos de validação a um campo privado ou propriedade {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Não é possível validar propriedades ou campos privados. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - O tipo {0} não tem campos ou propriedades para validar, referenciados do membro {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Um tipo de membro não tem campos ou propriedades a serem validados. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - O tipo {0} não tem campos ou propriedades para validar, referenciados por tipo {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Um tipo não tem campos ou propriedades a serem validados. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] não pode ser usado em membros do tipo {0}, pois ele não implementa IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - O tipo de membro não é enumerável. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Tipo de validador nulo especificado nos atributos [ValidateObjectMembers] ou [ValidateEnumeratedItems]. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Tipo de validador nulo especificado para os atributos "ValidateObjectMembersAttribute" ou "ValidateEnumeratedItemsAttribute". + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - O tipo {0} tem anotações de validação, mas o membro {1} não especifica [ValidateEnumeratedItems], o que pode ser uma desatenção. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Membro potencialmente ausente na validação enumerável. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - O tipo {0} tem anotações de validação, mas o membro {1} não especifica [ValidateObjectMembers], o que pode ser uma desatenção. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Membro potencialmente ausente na validação transitiva. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - O tipo de validador {0} não tem um construtor sem parâmetros. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Os validadores usados para validação transitiva ou enumerável devem ter um construtor sem parâmetros. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ru.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ru.xlf index 02fb57d..b8069e4 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ru.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.ru.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - Тип {0} уже реализует метод Validate. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Тип уже содержит реализацию метода Validate. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] невозможно применить к статическому классу {0}. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - Параметр OptionsValidatorAttribute не может быть применен к статическому классу. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - Нельзя использовать [ValidateObjectMembers] или [ValidateEnumeratedItems] для полей или свойств с открытыми универсальными типами {0}. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Нельзя использовать "ValidateObjectMembersAttribute" или "ValidateEnumeratedItemsAttribute" для полей или свойств с открытыми универсальными типами. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Не удалось применить атрибуты проверки к константе или статическому элементу {0}. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Не удалось проверить константы, статические поля или свойства. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Существует циклическая ссылка на тип, включающая тип {0}, предотвращающий его использование для статической проверки. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Неподдерживаемые циклические ссылки в типах моделей. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - Тип {0} не реализует требуемый интерфейс IValidateOptions<{1}>. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - Тип с аннотацией OptionsValidatorAttribute не реализует необходимый интерфейс. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - Атрибут проверки "{0}" элемента "{1}" недоступен из типа средства проверки "{2}". + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - Атрибут проверки элемента недоступен из типа средства проверки. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Не удается применить атрибуты проверки к закрытому полю или свойству {0}. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Не удается проверить частные поля или свойства. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - Тип {0} не содержит полей или свойств для проверки, на которые ссылается из элемента {1}. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Тип элемента не имеет полей или свойств для проверки. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - Тип {0} не содержит полей или свойств для проверки, на которые ссылается тип {1}. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Тип не имеет полей или свойств для проверки. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] не может использоваться для элементов типа {0}, так как он не реализует IEnumerable<T>. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Тип элемента не является перечисляемым. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - Тип проверяющего элемента управления, указанный в [ValidateObjectMembers] или [ValidateEnumeratedItems] атрибутах, имеет значение NULL. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - Для атрибутов ValidateObjectMembersAttribute или ValidateEnumeratedItemsAttribute указан тип проверяющего элемента управления NULL. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - Тип {0} содержит примечания проверки, но элемент {1} не указывает [ValidateEnumeratedItems], который может быть задан. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Элемент потенциально пропускает перечисляемую проверку. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - Тип {0} содержит примечания проверки, но элемент {1} не указывает [ValidateObjectMembers], который может быть задан. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Возможно, в элементе отсутствует транзитивная проверка. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - Тип проверяющего элемента управления {0} не имеет конструктора без параметров. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - У проверяющих элементов управления, используемых для транзитивной или перечисляемой проверки, должен быть конструктор без параметров. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.tr.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.tr.xlf index 6743bab..8cb34b9 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.tr.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.tr.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - {0} türü Doğrulama yöntemini zaten uyguluyor. + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - Bir tür zaten 'Validate' yönteminin bir uygulamasını içeriyor. + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator], {0} statik sınıfına uygulanamıyor. + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 'OptionsValidatorAttribute' statik sınıfa uygulanamaz. + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - {0} açık genel türündeki alanlarda veya özelliklerde [ValidateObjectMembers] veya [ValidateEnumeratedItems] kullanılamaz. + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - Açık genel türleri olan alanlarda veya özelliklerde 'ValidateObjectMembersAttribute' veya 'ValidateEnumeratedItemsAttribute' kullanılamaz. + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - Doğrulama öznitelikleri sabit veya statik üye {0} için geçerli değildir. + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - Sabitler, statik alanlar veya özellikler doğrulanamıyor. + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - Statik doğrulama için kullanılmasını engelleyen {0} türü içeren döngüsel bir tür başvurusu var. + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - Model türlerde döngüsel başvurular desteklenmiyor. + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - {0} türü gerekli IValidateOptions<{1}> arabirimini uygulamıyor. + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - 'OptionsValidatorAttribute' ile açıklama eklenmiş bir tür gerekli arabirimi uygulamıyor. + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - '{1}' adlı üye üzerindeki '{0}' doğrulama özniteliğine '{2}' doğrulayıcı türünden erişilemiyor. + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - Üye üzerindeki doğrulama özniteliğine doğrulayıcı türünden erişilemiyor. + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - Doğrulama öznitelikleri, {0} özel alanına veya özelliğine uygulanamıyor. + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - Özel alanlar veya özellikler doğrulanamıyor. + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - {0} türünde doğrulanacak alan veya özellik yok, {1} üyesinden başvurulur. + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - Üye türünde doğrulanacak alan veya özellik yok. + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - {0} türünde doğrulanacak alan veya özellik yok, {1} türü tarafından başvurulur. + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - Türde doğrulanacak alan veya özellik yok. + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems], IEnumerable<T> uygulamadığından {0} türündeki üyeler üzerinde kullanılamıyor. + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - Üye türü numaralandırılabilir değil. + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - [ValidateObjectMembers] veya [ValidateEnumeratedItems] özniteliklerinde null doğrulayıcı türü belirtildi. + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - 'ValidateObjectMembersAttribute' veya 'ValidateEnumeratedItemsAttribute' öznitelikleri için null doğrulayıcı türü belirtildi. + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - {0} türünde doğrulama ek açıklamaları var, ancak {1} üyesi gözden kaçmış olabilecek [ValidateEnumeratedItems] belirtmiyor. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - Üyede numaralandırılabilir doğrulama eksik olabilir. + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - {0} türünde doğrulama ek açıklamaları var, ancak {1} üyesi gözden kaçmış olabilecek [ValidateObjectMembers] belirtmiyor. + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - Üyede geçişli doğrulama eksik olabilir. + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - {0} doğrulayıcı türü parametresiz bir oluşturucuya sahip değil. + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - Geçişli veya numaralandırılabilir doğrulama için kullanılan doğrulayıcıların parametresi olmayan bir oluşturucusu olmalıdır. + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hans.xlf index cd68a3a..707dcb3 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hans.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - 类型 {0} 已实现 Validate 方法。 + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - 类型已包含“Validate”方法的实现。 + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] 无法应用于静态类 {0}。 + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - “OptionsValidatorAttribute”不能应用于静态类。 + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - 不能对具有开放泛型类型 {0} 的字段或属性使用 [ValidateObjectMembers] 或 [ValidateEnumeratedItems]。 + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - 不能对具有开放泛型类型的字段或属性使用 "ValidateObjectMembersAttribute" 或 "ValidateEnumeratedItemsAttribute"。 + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - 无法将验证属性应用于常量或静态成员 {0}。 + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - 无法验证常量、静态字段或属性。 + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - 存在一个循环类型引用,其中涉及的类型 {0} 阻止将其用于静态验证。 + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - 模型类型中不支持的循环引用。 + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - 类型 {0} 未实现所需的 IValidateOptions<{1}> 接口。 + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - 用 "OptionsValidatorAttribute" 批注的类型未实现必要的接口。 + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - 无法从验证程序类型“{2}”访问成员“{1}”上的验证属性“{0}”。 + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - 无法从验证程序类型访问成员上的验证属性。 + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - 无法将验证属性应用于专用字段或属性 {0}。 + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - 无法验证专用字段或属性。 + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - 类型 {0} 没有要验证的字段或属性,从成员 {1} 中引用。 + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - 成员类型没有要验证的字段或属性。 + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - 类型 {0} 没有要验证的字段或属性,由类型 {1} 引用。 + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - 类型没有要验证的字段或属性。 + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - 无法对类型 {0} 的成员使用 [ValidateEnumeratedItems],因为它未实现 IEnumerable<T>。 + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - 成员类型不可枚举。 + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - [ValidateObjectMembers] 或 [ValidateEnumeratedItems] 属性中指定的 Null 验证程序类型。 + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - 为“ValidateObjectMembersAttribute”或“ValidateEnumeratedItemsAttribute”属性指定的验证程序类型为 Null。 + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - 类型 {0} 具有验证注释,但成员 {1} 未指定 [ValidateEnumeratedItems],这可能是一种监督。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - 成员可能缺少可枚举验证。 + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - 类型 {0} 具有验证注释,但成员 {1} 未指定 [ValidateObjectMembers],这可能是一种监督。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - 成员可能缺少可传递验证。 + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - 验证程序类型 {0} 没有无参数构造函数。 + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - 用于可传递验证或可枚举验证的验证程序必须具有没有参数的构造函数。 + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hant.xlf index f21a748..f808718 100644 --- a/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/libraries/Microsoft.Extensions.Options/gen/Resources/xlf/Strings.zh-Hant.xlf @@ -4,152 +4,162 @@ Type {0} already implements the Validate method. - 類型 {0} 已實作 [驗證] 方法。 + Type {0} already implements the Validate method. A type already includes an implementation of the 'Validate' method. - 類型已經包含 [驗證] 方法的實作。 + A type already includes an implementation of the 'Validate' method. [OptionsValidator] cannot be applied to static class {0}. - [OptionsValidator] 無法套用至靜態類別 {0}。 + [OptionsValidator] cannot be applied to static class {0}. 'OptionsValidatorAttribute' can't be applied to a static class. - 無法將 'OptionsValidatorAttribute' 套用至靜態類別。 + 'OptionsValidatorAttribute' can't be applied to a static class. Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. - 無法在有開放式泛型型別 {0} 的欄位或屬性上使用 [ValidateObjectMembers] 或 [ValidateEnumeratedItems]。 + Can't use [ValidateObjectMembers] or [ValidateEnumeratedItems] on fields or properties with open generic type {0}. Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. - 無法在有開放式泛型型別的欄位或屬性上使用 'ValidateObjectMembersAttribute' 或 'ValidateEnumeratedItemsAttribute'。 + Can't use 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' on fields or properties with open generic types. Can't apply validation attributes to constant or static member {0}. - 無法將驗證屬性套用至常數或靜態成員 {0}。 + Can't apply validation attributes to constant or static member {0}. Can't validate constants, static fields or properties. - 無法驗證常數、靜態欄位或屬性。 + Can't validate constants, static fields or properties. There is a circular type reference involving type {0} preventing it from being used for static validation. - 有涉及類型 {0} 的循環類型參考讓它無法用於靜態驗證。 + There is a circular type reference involving type {0} preventing it from being used for static validation. Unsupported circular references in model types. - 模型類型中不支援的循環參考。 + Unsupported circular references in model types. Type {0} does not implement the required IValidateOptions<{1}> interface. - 類型 {0} 未實作必要的 IValidateOptions<{1}> 介面。 + Type {0} does not implement the required IValidateOptions<{1}> interface. A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. - 以 'OptionsValidatorAttribute' 附註的類型未實作必要的介面。 + A type annotated with 'OptionsValidatorAttribute' doesn't implement the necessary interface. Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. - 無法從驗證程式類型 '{2}' 存取成員 '{1}' 上的驗證屬性 '{0}'。 + Validation attribute '{0}' on the member '{1}' is inaccessible from the validator type '{2}'. Validation attribute on the member is inaccessible from the validator type.. - 無法從驗證程式類型存取成員上的驗證屬性。 + Validation attribute on the member is inaccessible from the validator type.. Can't apply validation attributes to private field or property {0}. - 無法將驗證屬性套用至私用欄位或屬性 {0}。 + Can't apply validation attributes to private field or property {0}. Can't validate private fields or properties. - 無法驗證私人欄位或屬性。 + Can't validate private fields or properties. Type {0} has no fields or properties to validate, referenced from member {1}. - 參照會員 {1},類型 {0} 沒有欄位或屬性可供驗證。 + Type {0} has no fields or properties to validate, referenced from member {1}. A member type has no fields or properties to validate. - 成員類型沒有欄位或屬性可供驗證。 + A member type has no fields or properties to validate. Type {0} has no fields or properties to validate, referenced by type {1}. - 參照類型 {1},類型 {0} 沒有欄位或屬性可供驗證。 + Type {0} has no fields or properties to validate, referenced by type {1}. A type has no fields or properties to validate. - 類型沒有欄位或屬性可供驗證。 + A type has no fields or properties to validate. [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. - [ValidateEnumeratedItems] 無法用於類型 {0} 的成員,因為其未實作 IEnumerable<T>。 + [ValidateEnumeratedItems] cannot be used on members of type {0} as it doesn't implement IEnumerable<T>. Member type is not enumerable. - 成員類型無法列舉。 + Member type is not enumerable. Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. - [ValidateObjectMembers] 或 [ValidateEnumeratedItems] 屬性中指定的 Null 驗證程式類型。 + Null validator type specified in [ValidateObjectMembers] or [ValidateEnumeratedItems] attributes. Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. - 為 'ValidateObjectMembersAttribute' 或 'ValidateEnumeratedItemsAttribute' 屬性指定的 Null 驗證程式類型。 + Null validator type specified for the 'ValidateObjectMembersAttribute' or 'ValidateEnumeratedItemsAttribute' attributes. + + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + + + + C# language version not supported by the source generator. + C# language version not supported by the source generator. Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. - 成員 {0} 具備驗證註釋,但成員 {1} 未指定 [ValidateObjectMembers] (可能為監督)。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateEnumeratedItems] which could be an oversight. Member potentially missing enumerable validation. - 成員可能遺漏可列舉的驗證。 + Member potentially missing enumerable validation. Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. - 類型 {0} 具備驗證註釋,但成員 {1} 未指定 [ValidateObjectMembers] (可能為監督)。 + Type {0} has validation annotations, but member {1} doesn't specify [ValidateObjectMembers] which could be an oversight. Member potentially missing transitive validation. - 成員可能遺漏轉移的驗證。 + Member potentially missing transitive validation. Validator type {0} doesn't have a parameterless constructor. - 驗證程式類型 {0} 沒有無參數建構函式。 + Validator type {0} doesn't have a parameterless constructor. Validators used for transitive or enumerable validation must have a constructor with no parameters. - 用於轉移或可列舉驗證的驗證程式必須具備沒有參數的建構函式。 + Validators used for transitive or enumerable validation must have a constructor with no parameters. diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs index b243ee5..f3e0513a 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Main.cs @@ -1582,6 +1582,63 @@ namespace __OptionValidationStaticInstances Assert.Equal(DiagDescriptors.NotEnumerableType.Id, diagnostics[0].Id); } + [ConditionalFact(typeof(PlatformDetection), nameof(PlatformDetection.IsNotBrowser))] + public async Task LanguageVersionTest() + { + string source = """ + using System; + using System.ComponentModel.DataAnnotations; + using Microsoft.Extensions.Options; + + public class FirstModel + { + [Required] + public string? P1 { get; set; } + } + + [OptionsValidator] + public partial class FirstModelValidator : IValidateOptions + { + } + """; + + Assembly [] refAssemblies = new [] + { + Assembly.GetAssembly(typeof(RequiredAttribute)), + Assembly.GetAssembly(typeof(OptionsValidatorAttribute)), + Assembly.GetAssembly(typeof(IValidateOptions)), + }; + + // Run the generator with C# 7.0 and verify that it fails. + var (diagnostics, generatedSources) = await RoslynTestUtils.RunGenerator( + new Generator(), refAssemblies.ToArray(), new[] { source }, includeBaseReferences: true, LanguageVersion.CSharp7).ConfigureAwait(false); + + Assert.NotEmpty(diagnostics); + Assert.Equal("SYSLIB1216", diagnostics[0].Id); + Assert.Empty(generatedSources); + + // Run the generator with C# 8.0 and verify that it succeeds. + (diagnostics, generatedSources) = await RoslynTestUtils.RunGenerator( + new Generator(), refAssemblies.ToArray(), new[] { source }, includeBaseReferences: true, LanguageVersion.CSharp8).ConfigureAwait(false); + + Assert.Empty(diagnostics); + Assert.Single(generatedSources); + + // Compile the generated code with C# 7.0 and verify that it fails. + CSharpParseOptions parseOptions = new CSharpParseOptions(LanguageVersion.CSharp7); + SyntaxTree syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedSources[0].SourceText.ToString(), parseOptions); + var diags = syntaxTree.GetDiagnostics().ToArray(); + Assert.Equal(1, diags.Length); + // error CS8107: Feature 'nullable reference types' is not available in C# 7.0. Please use language version 8.0 or greater. + Assert.Equal("CS8107", diags[0].Id); + + // Compile the generated code with C# 8.0 and verify that it succeeds. + parseOptions = new CSharpParseOptions(LanguageVersion.CSharp8); + syntaxTree = SyntaxFactory.ParseSyntaxTree(generatedSources[0].SourceText.ToString(), parseOptions); + diags = syntaxTree.GetDiagnostics().ToArray(); + Assert.Equal(0, diags.Length); + } + private static CSharpCompilation CreateCompilationForOptionsSource(string assemblyName, string source, string? refAssemblyPath = null) { // Ensure the generated source compiles diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Resources/Strings.resx index c6d9021..6b8167e 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Resources/Strings.resx +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGeneration.Unit.Tests/Resources/Strings.resx @@ -210,4 +210,10 @@ Validation attribute on the member is inaccessible from the validator type.. + + C# language version not supported by the source generator. + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + \ No newline at end of file diff --git a/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Resources/Strings.resx b/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Resources/Strings.resx index c6d9021..6b8167e 100644 --- a/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Resources/Strings.resx +++ b/src/libraries/Microsoft.Extensions.Options/tests/SourceGenerationTests/Resources/Strings.resx @@ -210,4 +210,10 @@ Validation attribute on the member is inaccessible from the validator type.. + + C# language version not supported by the source generator. + + + The options validation source generator is not available in C# {0}. Please use language version {1} or greater. + \ No newline at end of file diff --git a/src/libraries/System.Text.Json/gen/Resources/Strings.resx b/src/libraries/System.Text.Json/gen/Resources/Strings.resx index 85d64b6..519cbff 100644 --- a/src/libraries/System.Text.Json/gen/Resources/Strings.resx +++ b/src/libraries/System.Text.Json/gen/Resources/Strings.resx @@ -1,17 +1,17 @@ - @@ -193,7 +193,7 @@ C# language version not supported by the source generator. - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. Constructor annotated with JsonConstructorAttribute is inaccessible. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf index cc88af3..41ce767 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.cs.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Zdrojový generátor System.Text.Json není k dispozici v jazyce C#{0}. Použijte prosím jazykovou verzi {1} nebo vyšší. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Zdrojový generátor System.Text.Json není k dispozici v jazyce C#{0}. Použijte prosím jazykovou verzi {1} nebo vyšší. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf index d23d078..a0b49aa 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.de.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Der System.Text.Json-Quellgenerator ist in C# „{0}“ nicht verfügbar. Verwenden Sie die Sprachversion {1} oder höher. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Der System.Text.Json-Quellgenerator ist in C# „{0}“ nicht verfügbar. Verwenden Sie die Sprachversion {1} oder höher. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf index 989c5a8..bdd7876 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.es.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - El generador de origen System.Text.Json no está disponible en C# '{0}'. Use la versión de idioma {1} o superior. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + El generador de origen System.Text.Json no está disponible en C# '{0}'. Use la versión de idioma {1} o superior. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf index 4e1998a..4b93e17 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.fr.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Le générateur de source System.Text.Json n'est pas disponible en C# '{0}'. Veuillez utiliser la version linguistique {1} ou supérieure. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Le générateur de source System.Text.Json n'est pas disponible en C# '{0}'. Veuillez utiliser la version linguistique {1} ou supérieure. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf index 5cb68b2..cb163ff 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.it.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Il generatore di origine System.Text.Json non è disponibile in C# '{0}'. Usare la versione del linguaggio {1} o successiva. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Il generatore di origine System.Text.Json non è disponibile in C# '{0}'. Usare la versione del linguaggio {1} o successiva. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf index a25a901..9e3366a 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ja.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - System.Text.Json ソース ジェネレーターは C# '{0}' では使用できません。言語バージョン {1} 以上を使用してください。 + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + System.Text.Json ソース ジェネレーターは C# '{0}' では使用できません。言語バージョン {1} 以上を使用してください。 diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf index dec5ff5..735e6d7 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ko.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - System.Text.Json 원본 생성기는 C# '{0}'에서 사용할 수 없습니다. {1} 이상의 언어 버전을 사용하세요. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + System.Text.Json 원본 생성기는 C# '{0}'에서 사용할 수 없습니다. {1} 이상의 언어 버전을 사용하세요. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf index bb1a603..8282fa1 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pl.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Generator źródła System.Text.Json nie jest dostępny w języku C# „{0}”. Użyj wersji językowej lub nowszej {1} . + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Generator źródła System.Text.Json nie jest dostępny w języku C# „{0}”. Użyj wersji językowej lub nowszej {1} . diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf index a4cb21e..030a3f3 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.pt-BR.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - O gerador de fonte System.Text.Json não está disponível em C# '{0}'. Use a versão do idioma {1} ou superior. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + O gerador de fonte System.Text.Json não está disponível em C# '{0}'. Use a versão do idioma {1} ou superior. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf index d1c3241..556fa66 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.ru.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - Генератор исходного кода System.Text.Json не доступен в C# "{0}". Используйте языковую версию {1} или выше. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + Генератор исходного кода System.Text.Json не доступен в C# "{0}". Используйте языковую версию {1} или выше. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf index 72b706f..e74d881 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.tr.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - System.Text.Json kaynak oluşturucusu C# '{0}' içinde kullanılamıyor. Lütfen dil sürümü {1} veya üstü sürümü kullanın. + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + System.Text.Json kaynak oluşturucusu C# '{0}' içinde kullanılamıyor. Lütfen dil sürümü {1} veya üstü sürümü kullanın. diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf index 3450d31..3ac4929 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hans.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - System.Text.Json 源生成器在 C#“{0}”中不可用。请使用{1}或更高版本的语言版本。 + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + System.Text.Json 源生成器在 C#“{0}”中不可用。请使用{1}或更高版本的语言版本。 diff --git a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf index 176989f..a194d8a 100644 --- a/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf +++ b/src/libraries/System.Text.Json/gen/Resources/xlf/Strings.zh-Hant.xlf @@ -113,8 +113,8 @@ - The System.Text.Json source generator is not available in C# '{0}'. Please use language version {1} or greater. - C# '{0}' 中無法使用 System.Text.Json 來源產生器。請使用 {1} 或更新的語言版本。 + The System.Text.Json source generator is not available in C# {0}. Please use language version {1} or greater. + C# '{0}' 中無法使用 System.Text.Json 來源產生器。請使用 {1} 或更新的語言版本。 diff --git a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs index 98f2b71..a554d26 100644 --- a/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs +++ b/src/libraries/System.Text.Json/tests/System.Text.Json.SourceGeneration.Unit.Tests/JsonSourceGeneratorDiagnosticsTests.cs @@ -416,7 +416,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests using System.Text.Json.Serialization; namespace HelloWorld - { + { public class MyClass { public MyClass(int value) @@ -457,7 +457,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests using System.Text.Json.Serialization; namespace HelloWorld - { + { public class MyClass { public MyClass( @@ -504,7 +504,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests using System.Text.Json.Serialization; namespace HelloWorld - { + { public class MyClass { public MyClass(int value) @@ -531,7 +531,7 @@ namespace System.Text.Json.SourceGeneration.UnitTests var expectedDiagnostics = new DiagnosticData[] { - new(DiagnosticSeverity.Error, contextLocation, $"The System.Text.Json source generator is not available in C# '{langVersion.ToDisplayString()}'. Please use language version 9.0 or greater.") + new(DiagnosticSeverity.Error, contextLocation, $"The System.Text.Json source generator is not available in C# {langVersion.ToDisplayString()}. Please use language version 9.0 or greater.") }; CompilationHelper.AssertEqualDiagnosticMessages(expectedDiagnostics, result.Diagnostics); -- 2.7.4