<!--
{
  "availability" : [
    "macOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "AppKit",
  "identifier" : "/documentation/AppKit/NSSpellChecker/setLanguage(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "AppKit"
    ],
    "preciseIdentifier" : "c:objc(cs)NSSpellChecker(im)setLanguage:"
  },
  "title" : "setLanguage(_:)"
}
-->

# setLanguage(_:)

Returns whether the specified language is in the Spelling pop-up list.

```
func setLanguage(_ language: String) -> Bool
```

## Parameters

`language`

The requested language.

## Return Value

<doc://com.apple.documentation/documentation/Swift/true> if the language is available in the pop-up list, otherwise <doc://com.apple.documentation/documentation/Swift/false>.

## Discussion

The code listing below shows how languages can be specified in language. If the language specified is listed in the user’s list of preferred languages, the spell checker uses that language to accomplish its task.

Listing 1. Specifying the spell checker language

```objc
NSSpellChecker* spell_checker = [NSSpellChecker sharedSpellChecker];
 
// Sets language to French. The language method returns "fr".
[spell_checker setLanguage:@"fr"];
 
// Sets language to the one spoken in Netherlands (English). The language method returns "en".
[spell_checker setLanguage:@"NL"];
 
// Sets language to British English. The language method returns "en_GB".
[spell_checker setLanguage:@"en_GB"]
 
 // Sets language to German. The language method returns "de".
[spell_checker setLanguage:@"German"];
```

For information about the strings you can use to specify a language, see <doc://com.apple.documentation/documentation/Foundation/NSLocale>.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)