Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can you configure VS2008 Code Analysis to use a British English Dictionary?

VS2008 Code Analysis will flag a spelling mistake in an identifier using the IdentifiersShouldBeSpelledCorrectly warning type.

This process is using an American dictionary by default because words are being flagged that are correctly spelt using the British spelling. For example, words like "Organisation" and "Customisation", etc...

I am aware that you can create your own custom Xml dictionary files that contain any words you don't want to be flagged, however, can anyone tell me if you can configure Code Analysis to use a different default (or additional) dictionary from those available in Windows?

like image 896
Andy McCluggage Avatar asked Oct 27 '08 13:10

Andy McCluggage


2 Answers

Excellent, thanks.

A summary of the solution is...

Add the CodeAnalysisCulture line to the Project file. Unfortunately I think this has to be done for every project being analysed...

<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
    ...
    <RunCodeAnalysis>true</RunCodeAnalysis>
    <CodeAnalysisCulture>en-GB</CodeAnalysisCulture>
    ...

with "en-GB" as the value to get British English spellchecking.

like image 154
Andy McCluggage Avatar answered Nov 15 '22 06:11

Andy McCluggage


This should do it for you Visual Studio 2008 - Spelling rules

So simply replace en-AU with en-GB in the example given.

It quotes the rule IdentifiersShouldBeSpelledCorrectly.

like image 34
dove Avatar answered Nov 15 '22 07:11

dove