Skip to content

Show keyboard and input method errors in the current language - #18815

Merged
dhh merged 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/f5080716-e551-4959-9671-dd79dc095869
Nov 15, 2026
Merged

dhh merged 3 commits into
omacom:quattrofrom
ThePrimeagen:fix/f5080716-e551-4959-9671-dd79dc095869

Conversation

@ThePrimeagen

Copy link
Copy Markdown
Contributor

In Danish, a refused change in Keyboard Inputs or Input Methods shows a notification with a Danish title and an English body. default/input-methods/typing_setup.py translates the title but sends its English error text as the body.

Screenshots

Before After
before after

Reproduce

  1. Press Super+Return and run omarchy language da.
  2. Press Super+Space and open Setup > Keyboard > Keyboard Inputs.
  3. Click English (US), the only ticked layout, to untick it.
  4. The notification reads "Tastaturlayouter kunne ikke opdateres" over the English "Select at least one keyboard layout".

More cases

Input Methods: tick Japanese (Mozc) after sudo pacman -Rns fcitx5-mozc

Before After
before after

Keyboard Inputs: tick French while ~/.config/hypr/input.lua sets kb_layout = "de"

Before After
before after

Also affected

  • typing_setup.py input_items and save_keyboard: "The current input group has no keyboard input" stays English. Not fixed here.
  • typing_setup.py set_inputs and save_keyboard: "Fcitx did not retain the input/keyboard selection" stays English. Not fixed here.
  • typing_setup.py choose and apply_selection: "The selection menu could not open" and "The menu returned an invalid selection" stay English. Not fixed here.
  • typing_setup.py load_engines: the "its engine" fallback stays English inside the translated sentence. Not fixed here.

Related

The keyboard and input-method pickers showed Danish titles with English bodies because their errors were hard-coded English with no catalog keys. Add catalog entries for the empty-layout, missing-engine and personal-override errors and resolve them through omarchy-i18n where each error is raised, with an English fallback, so the shared handler notifies entirely in the current language.
@greptile-apps

greptile-apps Bot commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable issue remains.

Summary

Routes three keyboard and input-method error messages through omarchy-i18n.

  • Keyboard and input-method setup gets its errors from the language catalog.

Reviews (4) · Last reviewed commit: "Look typing setup errors up through omar..." · Reviewed by Greptile

Comment thread default/i18n/da/cli.json Resolved
ThePrimeagen and others added 2 commits November 13, 2026 15:35
Pull requests only add the English side of a string. Drop the three Danish
entries added by hand; the translation sync workflow adds them from the
English catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>
…backs

omarchy-i18n already falls back to the English catalog, and main() calls it with check=True right after to translate the title, so a second English copy of each string could never rescue a notification. The uninstalled-engine test now mocks only omarchy-pkg-present, so its message comes through the real catalog lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@omarchybot

Copy link
Copy Markdown
Collaborator

Pushed 7127f17 on top of this branch.

What changed and why. localized() ran omarchy-i18n and returned a hard-coded English copy of the string when that failed. omarchy-i18n already falls back to the English catalog. main() also calls it with check=True to translate the notification title right before posting, so the copy could never save a notification. The helper is now two lines and runs omarchy-i18n with check=True, as main() does. The call sites keep the "omarchy-i18n <key>" literal, because test/shell.d/i18n-test.sh finds referenced catalog keys by that pattern. The keys and catalog entries are unchanged.

Tests: kept, none added. This PR added no tests, and a string change gets none of its own. The English fallback existed mostly because test_an_uninstalled_engine_names_its_package_without_restarting mocked every subprocess.run call as failing. That mock now fakes only omarchy-pkg-present, so the "Install fcitx5-mozc to use Japanese" message comes from the real catalog lookup. The test still checks that a missing engine is refused without restarting or saving.

Proved on a worker built from the Omarchy ISO: typing-setup-test.sh passes 5 of 5 and i18n-test.sh passes 401 of 401. On a scratch copy with Danish selected and two Danish entries added for the probe, keyboard_values([]) raises "Vælg mindst ét tastaturlayout" and the engine message reads "Installer fcitx5-mozc for at bruge Japanese". On quattro these were English literals.

Second opinion: Codex Medium reviewed the commit and found nothing to change. It checked that every caller (seed_language, add_input and main()) still catches the OSError and CalledProcessError the helper can now raise, and that the narrowed mock passes real omarchy-i18n calls through. It reviewed this session's conclusions, so its independence is not guaranteed.

Waiting on the maintainer.

@dhh
dhh merged commit f1afc61 into omacom:quattro Nov 15, 2026
3 checks passed
ButtercupRobrts pushed a commit to ButtercupRobrts/omarchy that referenced this pull request Nov 28, 2026
…#18815)

* Translate typing setup error bodies via i18n

The keyboard and input-method pickers showed Danish titles with English bodies because their errors were hard-coded English with no catalog keys. Add catalog entries for the empty-layout, missing-engine and personal-override errors and resolve them through omarchy-i18n where each error is raised, with an English fallback, so the shared handler notifies entirely in the current language.

* Leave the Danish typing setup strings to the translation sync

Pull requests only add the English side of a string. Drop the three Danish
entries added by hand; the translation sync workflow adds them from the
English catalog.

Co-authored-by: Cursor <cursoragent@cursor.com>

* Look typing setup errors up through omarchy-i18n without English fallbacks

omarchy-i18n already falls back to the English catalog, and main() calls it with check=True right after to translate the title, so a second English copy of each string could never rescue a notification. The uninstalled-engine test now mocks only omarchy-pkg-present, so its message comes through the real catalog lookup.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: David Heinemeier Hansson <david@hey.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit f1afc61)
@emirb emirb added this to the 4.6.0 milestone Dec 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants