Skip to content

Let install media preset the language, keyboard and timezone - #15522

Merged
dhh merged 5 commits into
quattrofrom
install-language-preset
Oct 20, 2026
Merged

dhh merged 5 commits into
quattrofrom
install-language-preset

Conversation

@omarchybot

@omarchybot omarchybot commented Oct 15, 2026 •

Copy link
Copy Markdown
Collaborator

Install media built for one market should install in that market's language and keyboard, and with its timezone. The first is China: an ISO that installs in Simplified Chinese with the Pinyin keyboard row and China's timezone preselected. Every choice stays the user's to change, and media without a preset behave exactly as before. The ISO side is omacom/omarchy-iso#275.

  • Preselected form.

    • setup-form.sh, shared by the ISO configurator and first-boot owner setup, preselects OMARCHY_FORM_KEYBOARD_DEFAULT and OMARCHY_FORM_TIMEZONE_DEFAULT when the media sets them.
    • Otherwise it preselects English (US) and the network's guess, as before.
    • A deferred install finds the same defaults in /etc/omarchy/form-defaults, plain KEY=value lines read as data, so its owner setup preselects them too.
  • Language as data.

    • The installer writes a registry code to /etc/omarchy/language.
    • System finalization generates its locale as root through omarchy-locale-generate, after checking the code's shape.
    • User finalization makes it each new user's desktop language through omarchy-language seed. That writes the language and session LANG and nothing else: no elevation, no session bus, no notification. It keeps a language the user already chose. It doesn't seed an input method either, since the keyboard row the user picked decides that.
    • The system locale stays English, because the console cannot draw every script.
    • An installer language picker can write the same marker.
  • Region at first boot. A deferred install takes the media's region before anyone has chosen a timezone. Owner setup settles it once the owner picks one:

    • a timezone a region profile lists picks that region;
    • Hong Kong, Macau and Taiwan are always World;
    • anything else keeps the media's region;
    • a change re-renders pacman.

    This needs Add a World / China region for package mirrors and developer tool registries #13690's region profiles and renderer, and does nothing without them.

  • English folder names. Provisioning names and creates Downloads, Pictures, Videos, Documents and Music, so a first login in another language does not create translated folders beside the ones Omarchy made and bookmarked. A folder the user already named, in any language, stays theirs. The Omarchy 4 upgrade follows the same rule.

Fixes #15509.

omarchybot and others added 3 commits October 15, 2026 07:21
A China ISO should install in Chinese with the Pinyin keyboard row and the China timezone chosen, while every choice stays the user's to change. The setup form, shared by the ISO configurator and first-boot owner setup, now preselects OMARCHY_FORM_KEYBOARD_DEFAULT and OMARCHY_FORM_TIMEZONE_DEFAULT when the media sets them, and English (US) and the network's guess otherwise.

The language travels as data: the installer writes a registry code to /etc/omarchy/language, system finalization generates its locale as root, and user finalization makes it the user's desktop language through `omarchy-language seed`, which writes the language and session LANG without elevating, notifying, or seeding an input method over the keyboard row the user picked. The system locale stays English, since the console cannot draw every script. An installer language picker can write the same marker.

Provisioning also names the Downloads, Pictures, Videos, Documents and Music folders in English up front, so a first login in another language does not create translated folders beside the ones Omarchy made and bookmarked; the Omarchy 4 upgrade does the same where the user has not named them.

Fixes #15509.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ices to first-boot setup

Seeding a preset language now does nothing when the user already has one, so re-running provisioning after a change under Setup > Language keeps that choice, and it writes the session file without touching a session bus. Folder names are pinned only where the user has not named the folder, in any language, the same rule the Omarchy 4 upgrade follows.

Install media for one market can leave its keyboard and timezone choices in /etc/omarchy/form-defaults, read as data, so a first-boot owner setup preselects them as the live installer does; the live installer's own environment still wins.

Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
…create the folders it names

A deferred install from one market's media takes the media's region before anyone has chosen a timezone. First-boot owner setup now settles it once the owner picks one, when the media left that region as REGION in /etc/omarchy/form-defaults: a timezone a region profile lists picks that region, Hong Kong, Macau and Taiwan are always World, any other timezone keeps the media's region, and a change re-renders pacman for the installed channel.

The English folder names are created as well as recorded, since xdg-user-dirs resets a named folder that does not exist back to the home directory.

Co-Authored-By: Codex Medium <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@greptile-apps

greptile-apps Bot commented Oct 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The latest changes appear safe to merge; the earlier region-update retry issue remains non-blocking.

Findings

  1. P2 Failed region updates cannot retry ▶

Summary

Lets install media preset language, keyboard, and timezone while keeping each choice editable.

  • New users start with the desktop language chosen by the install media.
  • Setup starts with the keyboard and timezone chosen by the install media.
  • First boot matches the media region to the owner's timezone.
  • New users keep English folder names unless they chose their own.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Install media presets] --> B[Shared keyboard and timezone form]
  A --> C[Language marker]
  C --> D[System generates locale]
  D --> E[User setup seeds desktop language]
  B --> F[Owner confirms choices]
  F --> G[Apply keyboard and timezone]
  G --> H[Set region and render pacman]
Loading

Reviews (3) · Last reviewed commit: "Escape commas in the keyboard preselecti..." · Reviewed by Greptile

Comment on lines +929 to +937
if [[ $region == "global" ]]; then
rm -f "$marker"
else
printf '%s\n' "$region" >"$marker"
fi
# Re-render pacman for the region with the channel this machine installed.
channel=$(sed -n 's|^Server = https://pkgs\.omarchy\.[a-z]*/\([a-z]*\)/.*|\1|p' "$pacman_conf" | head -1)
if [[ -n $channel && -x $OMARCHY_PATH/bin/omarchy-apply-pacman ]]; then
"$OMARCHY_PATH/bin/omarchy-apply-pacman" "$channel" "${OMARCHY_REGION_TARGET:-/}" 2>&1 || true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Failed region updates cannot retry

configure_region saves the new region before checking whether omarchy-apply-pacman can run, and ignores failures when it does run. If the helper is missing or fails, the marker changes but pacman keeps its old sources. A retry then returns early because the marker already matches.

Check the required region files and helper before changing the marker, and restore the old marker if rendering fails.

@omarchybot

Copy link
Copy Markdown
Collaborator Author

Merged current quattro (61 commits) into this branch as 39936bb; it merged without conflicts. On a worker, the install-language, provision-owner-regdom, provision-user and setup-form tests pass. The one i18n failure (da/menu.json mirrors the English catalog) fails the same way on quattro. Not re-reviewed by Codex, since the merge changed none of this PR's own lines. Waiting on the maintainer.

omarchybot added a commit to omacom/omarchy-iso that referenced this pull request Oct 20, 2026
…m the language

The language picker is the first screen, so it now carries the intro and the hidden Ctrl+C entry into preparing the machine for another owner, and the keyboard screen is a plain layout list. The chosen language preselects its keyboard layout and, when the network cannot guess a timezone, its country's capital, from language-defaults.json; a preset's keyboard or timezone still wins. A setup form without omacom/omarchy#15522's OMARCHY_FORM_KEYBOARD_DEFAULT gets the layout through gum(), and the timezone comes in through a tzupdate function the form already calls.
gum splits --selected on commas, so a default like "Chinese (Simplified, Pinyin)" or "English (US, Dvorak)" never matched and the list stayed on English (US).
@omarchybot

Copy link
Copy Markdown
Collaborator Author

Pushed aade5e3: the keyboard prompt now escapes commas in its preselection. gum splits --selected on commas, so a media default like "Chinese (Simplified, Pinyin)" left the list on English (US). On a VM with real gum, the unescaped label selected English (US) and the escaped one selected the Pinyin row. setup-form-test passes (20/20). Codex Medium reviewed the diff and found nothing. Found while refreshing omarchy-iso#275.

@dhh
dhh merged commit 3ac4365 into quattro Oct 20, 2026
2 checks passed
@dhh
dhh deleted the install-language-preset branch October 20, 2026 15:14
omarchybot added a commit that referenced this pull request Oct 21, 2026
quattro's install-media presets (#15522) added keyboard preselection tests beside the French latin1 tests; both are kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
dhh added a commit to omacom/omarchy-iso that referenced this pull request Oct 24, 2026
* Ask for a language first and translate the installer into it

The configurator opens on a language picker listing every Omarchy language. The 35 whose scripts the console can draw also translate the configurator, the shared setup form and the install dashboard; the rest are listed by their English name, keep the installer in English, and still set the installed system's language through /etc/omarchy/language.

The live console now runs Terminus at the size the kernel picked, patched with the half blocks the logo needs, because the kernel's built-in fonts carry only the IBM PC character set.

* Keep a failed font probe from stopping the dashboard, and refuse unknown languages without a registry

The dashboard runs under set -euo pipefail, so an unguarded showconsolefont pipeline could end it before the installer started. Without the registry, an autoinstall could hand any well-formed code to the target, so only English passes then. Catalogs may now lag English, since a missing key already shows in English, and the README says how strings and catalogs work.

Co-Authored-By: Codex Medium <[email protected]>

* Shorten tips that the progress screen cut off at 81 columns

The dashboard truncates the tip line at the logo's width, and 47 translated tips ran past it. The test now holds every tip line to 80 columns.

* Open on the language screen and default the keyboard and timezone from the language

The language picker is the first screen, so it now carries the intro and the hidden Ctrl+C entry into preparing the machine for another owner, and the keyboard screen is a plain layout list. The chosen language preselects its keyboard layout and, when the network cannot guess a timezone, its country's capital, from language-defaults.json; a preset's keyboard or timezone still wins. A setup form without omacom/omarchy#15522's OMARCHY_FORM_KEYBOARD_DEFAULT gets the layout through gum(), and the timezone comes in through a tzupdate function the form already calls.

* Use kbd's LatGrkCyr-8x16 for the console and keep the progress whimsy in English

The stock font already draws Latin, Greek, Cyrillic and the logo's half blocks, so the patched Terminus and its builder go; setfont -d doubles it where the kernel picked a HiDPI font. gum's table draws square borders, which the font has, and Uzbek's ʻ is drawn as ‘. The alliterative progress lines stay English decoration, and validate_language relies on the registry alone.

* Escape commas in the keyboard preselection

gum splits --selected on commas, so the language default for Chinese, "Chinese (Simplified, Pinyin)", never preselected.

* Bring back the patched Terminus console font

kbd's LatGrkCyr-8x16 broke the logo: its half blocks leave gaps in the strokes and turn the Y into a broken U, and it draws thinner text, mangled key-hint arrows and faint pagination dots. Terminus at the kernel's size, with the half blocks drawn in and gum's rounded corners and Uzbek's ʻ mapped onto its own glyphs, looks the way the installer always has. The table keeps gum's default border, which those aliases draw.

* Draw в, д and и in their Russian forms on the live console

Terminus draws в at capital height, д with one descender and и like u:
the Bulgarian forms, which its author made the default. Readers of
Russian, Ukrainian, Serbian and the other Cyrillic languages the
installer offers see "Иван" as "ИВан" and "клавиатуры" as "клаВuатуры".

Terminus ships its own alternates for them, alt/dv1.diff (в, д) and
alt/ij1.diff (и, й, ѝ, ӣ). The patch draws those 4.49.1 bitmaps
(ter-u16b, ter-u32b) over ter-v's at both sizes the kernel picks, plus
the Ф of Debian's console-setup Terminus Bold, whose stem runs through
the bowl. Debian's в and д are the same as dv1's, bit for bit.

A form of the wrong size would shift every later glyph in the written
PSF, so patch() refuses one, and the test checks that only the half
blocks and these forms change.

* Draw the live console in DejaVu Sans Mono

Terminus draws letters that readers tell apart almost alike: б and Б
differ in 2-4 % of their pixels, υ and u in 3-4 %, y is u with a tail,
and v and ν, п and π, γ and ү, ħ and ћ, - and – share one glyph each.
On the Russian account screen "Латинские буквы" reads "Латинские
Буквы".

Ship two prebuilt fonts instead of patching Terminus at boot: DejaVu
Sans Mono, regular at 8x16 and bold at 16x32, rendered into the 512
characters of kbd's ter-v, so the console draws exactly what it drew
before. builder/console-font/dejavu-psf.py makes them from DejaVu 2.37
with FreeType 2.13.2; its README pins the inputs and the output hashes,
and the test rebuilds both byte for byte when freetype-py is present.
The letters Terminus shared a glyph between move to the slots of five
CP437 symbols nothing on the ISO prints or a keymap types. Glyphs too
wide for the cell lose columns that repeat their neighbour, Ύ gets its
tonos above, box drawing and blocks sit on a baseline of their own and
fill the cell, and the shades are plain dithers. No Terminus glyph is
in the fonts, so they carry DejaVu's license alone.

i18n.sh loads the font for the cell size the kernel picked, 8x16 up to
about 1920x1200 and 16x32 above, and console-font.py goes. The new
tests fail on the patched Terminus (16 of the lookalike checks) and
pass on these fonts.

* Revert "Draw the live console in DejaVu Sans Mono"

This reverts commit 6f1a4fd. The maintainer prefers the look of the patched Terminus, so the live console goes back to it. The Russian forms of в, д and и from 78225df stay, drawn from Terminus's own alternate glyphs.

* Leave install media presets to #275

preset.json doesn't exist on quattro yet. The language, keyboard and
timezone presets, and the language_prompt switch that moved the intro to
the keyboard screen, belong with the pull request that adds the file.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: omarchybot <[email protected]>
Co-authored-by: Codex Medium <[email protected]>
Co-authored-by: Emir Beganovic <[email protected]>
Co-authored-by: David Heinemeier Hansson <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@emirb emirb added this to the 4.5 milestone Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

A non-English locale gets a second set of user folders next to ~/Downloads, ~/Pictures and ~/Videos

3 participants