Skip to content

Commit 0e3c8ab

Browse files
committed
fixes #655
1 parent a625458 commit 0e3c8ab

File tree

1 file changed

+19
-1
lines changed

1 file changed

+19
-1
lines changed

docs/code-quality/ca2204-literals-should-be-spelled-correctly.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,25 @@ This rule checks a literal string that is passed as a value to a parameter or pr
4141

4242
This rule parses the literal string into words, tokenizing compound words, and checks the spelling of each word or token. For information about the parsing algorithm, see [CA1704: Identifiers should be spelled correctly](../code-quality/ca1704-identifiers-should-be-spelled-correctly.md).
4343

44-
By default, the English (en) version of the spelling checker is used.
44+
## Language
45+
46+
The spell checker currently checks only against English-based culture dictionaries. You can change the culture of your project in the project file, by adding the **CodeAnalysisCulture** element.
47+
48+
For example:
49+
50+
```xml
51+
<Project ...>
52+
<PropertyGroup>
53+
<CodeAnalysisCulture>en-AU</CodeAnalysisCulture>
54+
```
55+
56+
If your string literals are managed in [resource files](/dotnet/framework/resources/creating-resource-files-for-desktop-apps), then instead of adding the **CodeAnalysisCulture** element to the project file, add one of the following attributes to the assembly:
57+
58+
- Use <xref:System.Resources.NeutralResourcesLanguageAttribute> to specify the *neutral culture* of your assembly if your resources are in the same assembly as your code.
59+
- Use <xref:System.Reflection.AssemblyCultureAttribute> to specify the assembly culture if your resources are in a satellite assembly.
60+
61+
> [!IMPORTANT]
62+
> If you set the culture to anything other than an English-based culture, this code analysis rule is silently disabled.
4563
4664
## How to fix violations
4765

0 commit comments

Comments
 (0)