Skip to content

Commit ca3da7a

Browse files
committed
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 signalapp#2013, specifically [this comment](https://github.com/oxen-io/session-desktop/issues/2013#issuecomment-998679090):
1 parent 74b706d commit ca3da7a

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ts/node/spell_check.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import { sync as osLocaleSync } from 'os-locale';
55

66
export const setup = (browserWindow: BrowserWindow, messages: any) => {
77
const { session } = browserWindow.webContents;
8-
const userLocale = osLocaleSync().replace(/_/g, '-');
8+
const userLocale = process.env.LANGUAGE
9+
? process.env.LANGUAGE
10+
: osLocaleSync().replace(/_/g, '-');
911
const userLocales = [userLocale, userLocale.split('-')[0]];
1012

1113
const available = session.availableSpellCheckerLanguages;

0 commit comments

Comments
 (0)