Electron: Languages supported by Windows spell check (non-Hunspell, like de-CH, etc) do not appear in the list of available languages

Steps to reproduce

  1. Go to Options → Editor → Behavior → Spellcheck languages
  2. Look for German (Switzerland): Option is missing
  3. Close Obsidian
  4. Manually add “de-CH” to the list of dictionaries in %appdata%\obsidian\Preferences
  5. Open Obsidian
  6. Write “schliesslich” in a note.
  7. Verify that the spelling rules for German (Switzerland) are applied and the word isn’t underlined in red.

Did you follow the troubleshooting guide? [Y/N]

Yes

Expected result

German (Switzerland) should be available through the GUI. It’s supported in Electron/Chrome and it looks like it’s also included in Obsidian.

Actual result

The language is missing from the options menu.

Environment

SYSTEM INFO:
Obsidian version: v1.8.4
Installer version: v1.8.4
Operating system: Windows 10 Pro 10.0.19044
Login status: not logged in
Language: en
Insider build toggle: off
Live preview: on
Base theme: adapt to system
Community theme: none
Snippets enabled: 0
Restricted mode: on

RECOMMENDATIONS:
none


Additional information

French (Switzerland) is missing as well when compared to Chrome, but manually adding “fr-CH” to the Preferences file doesn’t work. So, the reason it isn’t available in Obsidian seems to be a different one.

1 Like

Correction: French (Switzerland) can also be enabled by editing the Preferences file (“fr-CH”). So, there are at least two supported languages missing from the options menu:

  • German (Switzerland)
  • French (Switzerland)

As someone also experiencing this issue, is there a workaround?

Let me double check this.

My workaround for now is to edit the preferences file manually and add de-CH to the list of enabled dictionaries there. For example: “dictionaries”:[“en-GB”,“de-CH”]. It still won’t show up in the Options dialogue, but it’s working as expected in the background.

We get the list of available languages from Electron, that gets it from Chrome(ium).

There is no de-CH in chromium.

I tried to force de-CH like you did and it did not even stick.

This Preferences file sticks for me (Obsidian has to be restarted before it takes effect):

{“browser”:{“enable_spellchecking”:true},“spellcheck”:{“dictionaries”:[“de-CH”],“dictionary”:“”}}

And I can verify that the spelling rules for de-CH are applied with this Preferences file.

The word schliesslich isn’t marked as an error when it is set to de-CH, but if I replace the value with de-DE and restart Obsidian, it gets marked as an error.

If I insert an invalid language code such as de-XY, Obsidian doesn’t accept it and resets the Preferences file, but that doesn’t happen with de-CH.

I’m not sure how exactly it works, as it doesn’t seem to be included as a stand-alone dictionary (maybe it’s some kind of sub-dictionary), but it indeed works. It’s also an official option without any workarounds in Chrome.

No idea why it isn’t available for you, this is what it looks like for me using Chrome 136.0.7103.49 with a clean profile.

I appreciate you taking the time to help diagnosing this issue and I’m sorry it’s getting so complicated.

Ok, I think I understand what happens.

Somewhat recently Chrome started also supporting using the Windows built-in spellchecker service. So if you have Swiss-German language pack installed on Windows, that’s where the spellchecker for that language is coming from.

This is a feature that is currently unsupported/not exposed by Electron.

We will wait until this is implemented upstream.

1 Like

You’re right! I was able reproduce it with Italian (Switzerland). By default, Obsidian doesn’t accept “it-CH” as a language and removes it from the Preferences file. As soon as the language is added to Windows, Obsidian will keep it in there and actually use it in the background.

Looks like this feature is partially implemented in Electron and not fully fleshed out. Thank you for putting in the detective work to solve this!