Visual Studio Team System
Resource strings should be spelled correctly

TypeName

ResourceStringsShouldBeSpelledCorrectly

CheckId

CA1703

Category

Microsoft.Naming

Breaking Change

Non Breaking

Cause

A resource string contains one or more words that are not recognized by the Microsoft spelling checker library.

Rule Description

This rule parses the resource string into words (tokenizing compound words) and checks the spelling of each word/token. For information about the parsing algorithm, see Identifiers should be spelled correctly.

In order for this rule to fire the assemblies must be marked with the AssemblyCultureAttribute or the NeutralResourcesLanguageAttribute.

This rule only supports English based cultures. This rule will not fire for any other cultures. By default, the English (en) version of the spelling checker is used.

How to Fix Violations

To fix a violation of this rule, use complete words that are correctly spelled or add the words to a custom dictionary. For information about how to use custom dictionaries, see Identifiers should be spelled correctly.

When to Suppress Warnings

Do not suppress a warning from this rule. Correctly spelled words reduce the time it takes to learn new software libraries.

Related Rules

Resource string compound words should be cased correctly

Identifiers should be spelled correctly

Tags :


Community Content

David M. Kean - MSFT
The English version of the spelling checker isn't used by default

The statement The English (en) version of the spelling checker is used by default is actually incorrect. This rule will only fire if an assembly is marked with the NeutralResourcesLanguageAttribute or AssemblyCultureAttribute (normally for use by satellite assemblies only).

For example, specifying the following will cause Code Analysis to spell check resources using the English (United States) lexicon:

[C#]
 
[assembly: NeutralResourcesLanguage("en-US")]

[Visual Basic] 
 
<Assembly: NeutralResourcesLanguage("en-US")>
 

[C++]
 
[assembly: NeutralResourcesLanguage("en-US")];


Whereas, specifying the following will cause Code Analysis to spell check resources using the English (Australia) lexicon:

[C#]
 
[assembly: NeutralResourcesLanguage("en-AU")]

[Visual Basic]
  
<Assembly: NeutralResourcesLanguage("en-AU")>

[C++]
  
[assembly: NeutralResourcesLanguage("en-AU")];
Tags :

Page view tracker