@@ -99,30 +99,21 @@ private static Task<Document> GetTransformedDocumentAsync(Document document, Syn
9999 ImmutableArray < string > standardText ;
100100 if ( declarationSyntax is ConstructorDeclarationSyntax )
101101 {
102+ var typeKindText = resourceManager . GetString ( isStruct ? "TypeTextStruct" : "TypeTextClass" , culture ) ;
102103 if ( declarationSyntax . Modifiers . Any ( SyntaxKind . StaticKeyword ) )
103104 {
104- if ( isStruct )
105- {
106- standardText = ImmutableArray . Create ( SA1642ConstructorSummaryDocumentationMustBeginWithStandardText . StaticConstructorStandardText , " struct." ) ;
107- }
108- else
109- {
110- standardText = ImmutableArray . Create ( SA1642ConstructorSummaryDocumentationMustBeginWithStandardText . StaticConstructorStandardText , " class." ) ;
111- }
105+ standardText = ImmutableArray . Create (
106+ resourceManager . GetString ( "StaticConstructorStandardTextFirstPart" , culture ) ,
107+ string . Format ( resourceManager . GetString ( "StaticConstructorStandardTextSecondPart" , culture ) , typeKindText ) ) ;
112108 }
113109 else
114110 {
115111 // Prefer to insert the "non-private" wording for all constructors, even though both are considered
116112 // acceptable for private constructors by the diagnostic.
117113 // https://github.com/DotNetAnalyzers/StyleCopAnalyzers/issues/413
118- if ( isStruct )
119- {
120- standardText = ImmutableArray . Create ( SA1642ConstructorSummaryDocumentationMustBeginWithStandardText . NonPrivateConstructorStandardText , " struct." ) ;
121- }
122- else
123- {
124- standardText = ImmutableArray . Create ( SA1642ConstructorSummaryDocumentationMustBeginWithStandardText . NonPrivateConstructorStandardText , " class." ) ;
125- }
114+ standardText = ImmutableArray . Create (
115+ resourceManager . GetString ( "NonPrivateConstructorStandardTextFirstPart" , culture ) ,
116+ string . Format ( resourceManager . GetString ( "NonPrivateConstructorStandardTextSecondPart" , culture ) , typeKindText ) ) ;
126117 }
127118 }
128119 else if ( declarationSyntax is DestructorDeclarationSyntax )
0 commit comments