# Spell checking language

**URL:** https://community.silverbullet.md/t/spell-checking-language/4321
**Category:** SilverBullet+
**Created:** [August 12, 2026, 7:16pm UTC](https://community.silverbullet.md/t/spell-checking-language/4321 "2026-08-12T19:16:57Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Mr.Red](https://community.silverbullet.md/user_avatar/community.silverbullet.md/mr.red/32/821_2.png) [@Mr.Red](https://community.silverbullet.md/u/Mr.Red)
#### Post date: [August 13, 2026, 6:22am UTC](https://community.silverbullet.md/t/spell-checking-language/4321/2 "2026-08-13T06:22:53Z")

</div>

_Important note_: spell checking is a browser/native operation, and is not controled by silverbullet itself, therefor here is an also earlier post regarding spellcheck:

> [@Disabling spellcheck](https://community.silverbullet.md/t/disabling-spellcheck/2660/3):
>
> @benji @wouter I was able to disable the spellcheck by adding the following line of Space Lua to my space: js.window.document.querySelector(".cm-content").setAttribute("spellcheck", "false")

TL;DR  
To disable globally for SB:

```lua
js.window.document.querySelector(".cm-content").setAttribute("spellcheck", "false")

```

Using the exact same DOM manipulation strategy by applying the standard HTML `lang` attribute to the CodeMirror editor container (`.cm-content`)

To set a language globally, the snippet is:

```lua
js.window.document.querySelector(".cm-content").setAttribute("lang", "de")

```

_(Replace `"de"` with `"en"`, `"fr"`, `"es"`, or whichever language code you require.)_

### Per-Page Dynamic Language Setting

To set the language automatically based on the page you are viewing, you can hook into SilverBullet's page load event in Space Lua. You can define a frontmatter attribute on your page (such as `lang: de`) and update the editor attribute dynamically whenever a page loads.

Add something like this to a Space Lua block:

```lua
event.listen {  
  name = "editor:pageLoaded",  
  run = function(e)  
    local pageLang = "en"  
    local meta = editor.getCurrentPageMeta()  
    if meta and meta.lang then  
      pageLang = meta.lang  
    end  
  
    local editorEl = js.window.document.querySelector(".cm-content")  
    if editorEl then  
      editorEl.setAttribute("lang", pageLang)  
    end  
  end  
}

```

Now, on any page where you want a specific spellcheck language, simply add it to the page frontmatter at the top:

```yaml
---
lang: de
---

```

If a page omits the `lang` attribute, it will gracefully fall back to `"en"`.

_(Do ensure your browser actually has the corresponding language dictionaries installed for native spellcheck to function properly.)_

the code above was done using [Silverbullet - DeepWiki](https://deepwiki.com/search/why-doesnt-this-snippet-work-w_9a464221-8441-409f-a587-cae3658e121f?mode=fast) and tested by me if the actual lang is set by the script in the DOM, but i couldnt also test the spelling check, because the behaviour is specific to each browser and installed language directories 😉

... and no, i'm not an AI-bot 😛

---

_[View the full topic](https://community.silverbullet.md/t/spell-checking-language/4321)._
