Set the Windows spell-checking language from $LANGUAGE.

Session on Windows wants to spell-check using American English, no
matter what I do. This seems to be because it wrongly assumes my locale
to be `en-US`, when it is actually `en-GB`.

```
"spellcheck: setting languages to:  [\"en-US\"]","time":"2022-10-10T19:19:09.216Z"
```

With this patch, Windows will use `$LANGUAGE`, if set, to determine the
language to be used for spell-checking.

Linux is unaffected by this patch and will correctly infer the
spell-checking language from `$LANG`.

Create a .bat file and start Session from this:

```
@echo off
set LANGUAGE=en-GB
"C:\Users\ian\AppData\Local\Programs\Session\Session.exe" --lang=en-GB
```

Note that the use of `--lang=<language>` above sets only the Session UI
language, not the spell-checker language.

This is a partial fix for #2013, specifically [this comment](https://github.com/oxen-io/session-desktop/issues/2013#issuecomment-998679090):
pull/2551/head
Ian Macdonald 3 years ago
parent 74b706d121
commit ca3da7a603
No known key found for this signature in database
GPG Key ID: AE4C20556BA626FA

@ -5,7 +5,9 @@ import { sync as osLocaleSync } from 'os-locale';
export const setup = (browserWindow: BrowserWindow, messages: any) => {
const { session } = browserWindow.webContents;
const userLocale = osLocaleSync().replace(/_/g, '-');
const userLocale = process.env.LANGUAGE
? process.env.LANGUAGE
: osLocaleSync().replace(/_/g, '-');
const userLocales = [userLocale, userLocale.split('-')[0]];
const available = session.availableSpellCheckerLanguages;

Loading…
Cancel
Save