As far as I can tell, browsers don’t currently support setting the
lang attribute on a
contenteditable element to change the language used by the native spellchecker.
Is that correct, or might there be a way to persuade the browser’s spellchecker to use a different language for the editor?
Seems that way. Which is weird, as that would be the reasonable way to do this. I’m not aware of another way to choose the spell checker language, but I’ve never really looked into this.
That’s right, it’s not possible. This is largely because browser makers have been developing richtext editing features thinking that it will be the end user who makes all the decisions about what to do where and that they should not be restricted by the site making decisions for them (such as what language to input). We are working on changing their concept of how richtext editors work in practice as of today and this is one such aspect.
In this particular case, I’d like to let the user choose a locale and then set the spellchecker to that locale using the
lang attribute of the
You can consider this alternative solution for check spelling and grammar in ProseMirror: https://webspellchecker.com/wsc-proofreader/#proofreader-prosemirror
It provides an extensive list of options for configuration. Once of such options allows setting a specific language for proofreading in the editor.
Besides, we also take care about the privacy and security aspects when in comes to processing texts and storing the words added by end users to their personal dictionaries.