Skip to content

Commit 0b6cbb3

Browse files
author
Christian Käser
committed
Add DocumentationSettings.DocumentationCulture option
1 parent 09075ff commit 0b6cbb3

2 files changed

Lines changed: 21 additions & 0 deletions

File tree

StyleCop.Analyzers/StyleCop.Analyzers/Settings/ObjectModel/DocumentationSettings.cs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ internal class DocumentationSettings
2121
/// </summary>
2222
internal const string DefaultCopyrightText = "Copyright (c) {companyName}. All rights reserved.";
2323

24+
/// <summary>
25+
/// The default value for the <see cref="DocumentationCulture"/> property.
26+
/// </summary>
27+
internal const string DefaultDocumentationCulture = "en-US";
28+
2429
/// <summary>
2530
/// This is the backing field for the <see cref="CompanyName"/> property.
2631
/// </summary>
@@ -92,6 +97,12 @@ internal class DocumentationSettings
9297
[JsonProperty("fileNamingConvention", DefaultValueHandling = DefaultValueHandling.Include)]
9398
private FileNamingConvention fileNamingConvention;
9499

100+
/// <summary>
101+
/// This is the backing field for the <see cref="DocumentationCulture"/> property.
102+
/// </summary>
103+
[JsonProperty("documentationCulture", DefaultValueHandling = DefaultValueHandling.Include)]
104+
private string documentationCulture;
105+
95106
/// <summary>
96107
/// Initializes a new instance of the <see cref="DocumentationSettings"/> class during JSON deserialization.
97108
/// </summary>
@@ -110,6 +121,8 @@ protected internal DocumentationSettings()
110121
this.documentInterfaces = true;
111122
this.documentPrivateFields = false;
112123

124+
this.documentationCulture = DefaultDocumentationCulture;
125+
113126
this.fileNamingConvention = FileNamingConvention.StyleCop;
114127
}
115128

@@ -163,6 +176,9 @@ public bool XmlHeader
163176
public FileNamingConvention FileNamingConvention =>
164177
this.fileNamingConvention;
165178

179+
public string DocumentationCulture =>
180+
this.documentationCulture;
181+
166182
public string GetCopyrightText(string fileName)
167183
{
168184
string copyrightText = this.copyrightTextCache;

StyleCop.Analyzers/StyleCop.Analyzers/Settings/stylecop.schema.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,11 @@
204204
"description": "Specifies the preferred naming convention for files. The default value \"stylecop\" uses the naming convention defined by StyleCop Classic, while \"metadata\" uses a file naming convention that matches the metadata names of types.",
205205
"default": "stylecop",
206206
"enum": [ "stylecop", "metadata" ]
207+
},
208+
"documentationCulture": {
209+
"type": "string",
210+
"description": "The culture that should be used for documentation comments.",
211+
"default": "en-US"
207212
}
208213
}
209214
}

0 commit comments

Comments
 (0)