# Setting the spellcheck language with lang attribute

**URL:** <https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672>\
**Category:** Uncategorized\
**Created:** [December 3, 2018, 4:34pm UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672 "2018-12-03T16:34:46Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![aeaton](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/aeaton/32/474_2.png) [@aeaton](https://discuss.prosemirror.net/u/aeaton)\
**Post date:** [December 3, 2018, 4:34pm UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672/1 "2018-12-03T16:34:46Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![marijn](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/marijn/32/15_2.png) [@marijn](https://discuss.prosemirror.net/u/marijn)\
**Post date:** [December 4, 2018, 8:05am UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672/2 "2018-12-04T08:05:45Z")

</div>

> [@aeaton](#):
>
> 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.

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.

---

<div class="post-metadata">

**Author:** ![johanneswilm](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/johanneswilm/32/19_2.png) [@johanneswilm](https://discuss.prosemirror.net/u/johanneswilm)\
**Post date:** [December 7, 2018, 10:59am UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672/3 "2018-12-07T10:59:36Z")

</div>

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.

Also, we cannot get access to the spell checker in JavaScript for security reasons as users may have added personal data into their own dictionary (name of girlfriend, address, credit card number, etc.) so by checking large amounts of text in JavaScript, one would be able to at some point to determine that certain words that are not in the default dictionary are in the user’s dictionary - which means they must have added them themselves and can be used for finger printing and/or getting to personal details of the user. Not all the browser devs agree with this assessment of a security risk, so it could change at some point.

---

<div class="post-metadata">

**Author:** ![aeaton](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/aeaton/32/474_2.png) [@aeaton](https://discuss.prosemirror.net/u/aeaton)\
**Post date:** [January 4, 2019, 12:29pm UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672/4 "2019-01-04T12:29:11Z")

</div>

> [@johanneswilm](#):
>
> 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).

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 `contenteditable` element.

---

<div class="post-metadata">

**Author:** ![julia.shaptala](https://discuss.prosemirror.net/user_avatar/discuss.prosemirror.net/julia.shaptala/32/858_2.png) [@julia.shaptala](https://discuss.prosemirror.net/u/julia.shaptala)\
**Post date:** [February 4, 2019, 9:54pm UTC](https://discuss.prosemirror.net/t/setting-the-spellcheck-language-with-lang-attribute/1672/5 "2019-02-04T21:54:29Z")

</div>

You can consider this alternative solution for check spelling and grammar in ProseMirror: [https://webspellchecker.com/wsc-proofreader/#proofreader-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.
