t3code icon indicating copy to clipboard operation
t3code copied to clipboard

[Bug]: Desktop spellcheck stays on OS locale (en-US) and underlines other languages

Open hevlyo opened this issue 3 months ago • 2 comments

Before submitting

  • [x] I searched existing issues and did not find a duplicate.
  • [x] I included enough detail to reproduce or investigate the problem.

Area

apps/desktop

Steps to reproduce

  1. Install the Linux desktop app (Nightly is enough).
  2. Keep the OS locale as English, for example LANG=en_US.UTF-8, while the keyboard layout is another language. Here that layout is Brazilian Portuguese (br / ABNT2).
  3. Open a new thread in the desktop composer.
  4. Type a normal Portuguese sentence, for example: Preciso revisar o relatório amanhã pela manhã.
  5. Optionally inspect the Chromium spellcheck dictionaries persisted for the app. On this machine they were only en-US.

This is not limited to Portuguese. The same thing happens for any language that is not the OS locale. Related closed request: https://github.com/pingdotgg/t3code/issues/2554 (Spanish, closed as "composer disables spellcheck"). That is not true on current Nightly: the underlines are still there, and there is still no settings control.

https://github.com/pingdotgg/t3code/issues/4253 / https://github.com/pingdotgg/t3code/pull/4254 are a different bug. They keep native English spellcheck attached and even enable spellcheck on the composer. They do not add a language picker or a disable toggle.

Expected behavior

The desktop composer should not treat correct text in another language as misspelled.

Concretely, one of these (ideally both):

  • A settings control to disable spellcheck.
  • A way to choose spellcheck dictionaries (for example pt-BR, en-US, or both), instead of inferring only from the OS locale.

Keyboard layout or the language being typed should matter more than LANG=en_US. Empty dictionary lists should not fall back to en-US when the user is writing something else.

Actual behavior

Every Portuguese word is underlined as misspelled. The app has persisted Chromium spellcheck dictionaries as ["en-US"] only. Electron's default is to fill that list from the OS locale, and an empty list falls back to en-US again, so the keyboard layout never comes into play.

There is no settings toggle to turn this off, and no UI to add pt-BR (Chromium already knows that dictionary; the browser on the same machine already had it downloaded).

Impact

Cosmetic issue

Version or commit

0.0.34-nightly.20260820.1142 (package t3code-nightly-bin)

Environment

  • OS: Linux (Arch / Omarchy 4), Wayland
  • App: T3 Code Nightly desktop (t3code-nightly)
  • Locale: LANG=en_US.UTF-8 (all LC_* the same)
  • Keyboard: br (ABNT2)
  • Electron/Chromium spellcheck dictionaries in the app user data: en-US only

Logs or stack traces

$ locale | head -1
LANG=en_US.UTF-8

# Chromium Preferences for the desktop app
spellcheck.dictionaries = ["en-US"]

# Dictionaries actually downloaded for the app
en-US-10-1.bdic   # present
pt-BR-*.bdic      # missing in the app; present in Chromium on the same machine

Electron documents this fallback: if getSpellCheckerLanguages() is empty, the spellchecker uses en-US, and on launch an empty list is populated from the OS locale. That matches what is stored here.

Workaround

Quit the desktop app, then either:

  • Clear spellcheck.dictionaries in the app Chromium Preferences and start with --disable-spell-checking, or
  • Add pt-BR to that dictionaries list (Chromium will download the .bdic).

Those are user-data hacks. The running session overwrites Preferences on quit unless the process is fully stopped first. They should not be required.

hevlyo avatar Aug 21 '26 01:08 hevlyo

Following the suggestion in #19290, adding my English + Polish use case here.

I use T3 Code on Manjaro Linux and would like English (en-US) and Polish (pl) spellchecking enabled together, without changing my system locale or editing Electron's profile manually.

On October 13, I inspected Nightly 0.0.46-nightly.20261013.3042. Its ~/.config/t3code-v2/Preferences contained only ["en-US"] under spellcheck.dictionaries, and I couldn't find a language-selection setting.

I have now tested the workaround: fully quit T3 Code, set spellcheck.dictionaries to ["en-US", "pl"], then reopen it. It works for my English + Polish use case.

I'd like to select both dictionaries in Settings and retain that selection across restarts. The multi-select picker proposed in #15996 matches this use case.

delor avatar Oct 14 '26 07:10 delor

Just a note: This is how i disabled the spellcheck on windows:

open AppData\Roaming\t3code-v2\Preferences

change from

{"spellcheck":{"dictionaries":["en-US"],"dictionary":"","use_spelling_service":false}}

to

{"browser":{"enable_spellchecking":false},"spellcheck":{"dictionaries":["en-US"],"dictionary":"","use_spelling_service":false}}

restart app

Christian-Schulz avatar Oct 20 '26 10:10 Christian-Schulz