AFFiNE icon indicating copy to clipboard operation
AFFiNE copied to clipboard

​Unable to set the document spellcheck language

Open fungs opened this issue 1 year ago • 1 comments

What happened?

I'm using the official Electron-based Linux app which is distributed as an AppImage.

The spellcheck can be enabled in the settings. I set the UI language to English and cleared the locale environment. However, the document spellcheck language seems to be picked up from the desktop environment somehow. That is confusing and wrong, and I don't know how to set it properly. It seems that the spellcheck is a built-in feature of electron that needs to be configured.

I propose to implement at least one of the following (from less to more preferred, in my opinion):

  1. Pick up the Linux locale variables or describe the mechanism to set the spellcheck language, if there is no setting.
  2. Set the spellcheck language in the settings dialog explicitly
  3. Set a language tag for each document that is respected by the spellcheck

Thanks!

fungs avatar Nov 15 '24 08:11 fungs

If there was meant to be a fix in 0.18.1, it does not seem to work.

locale
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8

Both AppImage and Flatpak versions default to a non-English locale when doing spellchecking. Maybe an explicit setting per document or workspace is easier and more correct (as I edit documents with different languages in different workspaces, or even within a workspace.

fungs avatar Nov 21 '24 15:11 fungs