How do you change which language the built in Spell Checker uses in Visual Studio 2022?
Asked Answered
M

2

12

I've recently updated my Microsoft Visual Studio Professional 2022 to version Version 17.5.2 and now get loads of spelling errors.

Is there a way to change the spell checker to use British English?

The flood of warnings for "Spelling error - Colour is not a word" is not helpful at all.

My windows language and region settings are set to English (United Kingdom).

Mikvah answered 21/3, 2023 at 9:27 Comment(1)
developercommunity.visualstudio.com/t/…Grobe
B
2

You can configure the spell checker through an .editorconfig file, as stated in the blog post about the spell checker here:

spelling_languages = _language_[,_language_]
(Example: = en-us,fr-fr)

I believe in your case, you want it to be:

spelling_languages = en-gb

The documentation also states the proper language pack must be installed, or it won't work (sounds like you already have that taken care of):

Note that the fr-fr language pack must be installed on the user’s machine or Visual Studio will incorrectly flag any French words as spelling errors.

Bayern answered 21/3, 2023 at 13:9 Comment(5)
I have tried that but it had no effect. Still complains about colour. I can only see a single language pack for English, there are not different English versions.Mikvah
@Mikvah an alternative may be to use the spelling_exclusion_path which allows you to specify a .dic file of words that should be ignored. This might not be ideal if you have a lot of words to add, but I can only think of a handful of words that are spelt different between US and GB English.Bayern
For anyone try it should be "spelling_languages" not "spelling_lanaguages"Pilferage
I don't know how to change the language, but you can at least switch it off (and on) in visual studio (tested on Microsoft Visual Studio Professional 2022 (64-bit) Version 17.5.4) under edit/advanced/toggle text spell checker.Rothman
Sorry for the delayed response but "spelling_languages = en-gb" worked with the correct spelling ^^Mikvah
M
8

Windows needs to have the correct language pack installed.

Use powershell to get things set up and restart visual studio.

PS C:\> Install-Language en-gb

I found out that the .editorconfig parser is quite picky, try to start with a minimal version like that:

[*]
spelling_languages = en-US,en-GB
spelling_exclusion_path = .\exclusion.dic
Midvictorian answered 24/5, 2023 at 20:30 Comment(3)
Windows is set to UK English, Visual Studio is still complaining about my English spelling of colour.Mikvah
Just to be certain. Powershell command PS C:\> Get-InstalledLanguage does list something like (containing en-US): Language Language Packs Language Features -------- -------------- ----------------- de-AT None TextToSpeech de-DE LpCab, LXP BasicTyping, Handwriting, Speech, TextToSpeech, OCR en-US LpCab BasicTyping, Handwriting, Speech, TextToSpeech, OCR In my case adding "en-US" was sufficent to get "Colour" and "Color" passing spell checking.Midvictorian
Works great on my laptop, but what do I do on the terminal server, where these cmdlets are not supported? Their documentation explicitly states These cmdlets are supported on client operating system only. (taken from learn.microsoft.com/en-us/powershell/module/…)Agnail
B
2

You can configure the spell checker through an .editorconfig file, as stated in the blog post about the spell checker here:

spelling_languages = _language_[,_language_]
(Example: = en-us,fr-fr)

I believe in your case, you want it to be:

spelling_languages = en-gb

The documentation also states the proper language pack must be installed, or it won't work (sounds like you already have that taken care of):

Note that the fr-fr language pack must be installed on the user’s machine or Visual Studio will incorrectly flag any French words as spelling errors.

Bayern answered 21/3, 2023 at 13:9 Comment(5)
I have tried that but it had no effect. Still complains about colour. I can only see a single language pack for English, there are not different English versions.Mikvah
@Mikvah an alternative may be to use the spelling_exclusion_path which allows you to specify a .dic file of words that should be ignored. This might not be ideal if you have a lot of words to add, but I can only think of a handful of words that are spelt different between US and GB English.Bayern
For anyone try it should be "spelling_languages" not "spelling_lanaguages"Pilferage
I don't know how to change the language, but you can at least switch it off (and on) in visual studio (tested on Microsoft Visual Studio Professional 2022 (64-bit) Version 17.5.4) under edit/advanced/toggle text spell checker.Rothman
Sorry for the delayed response but "spelling_languages = en-gb" worked with the correct spelling ^^Mikvah

© 2022 - 2024 — McMap. All rights reserved.