Repository navigation
Translate the setup form from Omarchy's catalogs and let callers give a timezone fallback - #16049
Conversation
[Medium impact] The PR appears safe to merge; no actionable issues were found. SummaryThe shared setup form reads translated prompts from Omarchy’s catalogs and accepts a caller-provided timezone fallback.
No actionable issues were found. Review checks were static; automated tests and visual checks were not run.
|
|
Opened for omacom/omarchy-iso#297's language picker, stacked on #15522 at aade5e3, so it keeps the comma escaping in the keyboard preselection. The form now reads |
|
Merged quattro (with #15522 squash-merged) in as 150c8ed. The conflicts in setup-form.sh and its test were this PR's own additions on top of the squashed copy, so I kept this PR's side. On a worker, setup-form (22 passed) and install-language tests pass. The one i18n failure (da/menu.json mirrors the English catalog) also fails on quattro. |
… a timezone fallback The ISO installer asks for a language first, but the setup form it shares with first-boot owner setup only speaks English, so the ISO had to swap its strings by their English text on the way to gum. The form now reads its strings from cli.json through omarchy_form_text, in the language the caller names in OMARCHY_FORM_LANGUAGE, with English filling in. The live ISO carries the catalogs but no omarchy-i18n and no user language file, which is why the caller names it. First-boot owner setup leaves it unset and stays English. OMARCHY_FORM_TIMEZONE_FALLBACK stands in when geo.omarchy.org can't place the machine, so the ISO can preselect the language's capital offline. The translations for the 35 languages the ISO's console can draw come over from the ISO's catalogs. The git identity prompt stays English: only ISO configurators from before omarchy-setup-git still call it, and they never name a language. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
150c8ed to
250957a
Compare
…staller With omacom/omarchy#16049 the shared setup form reads its strings from Omarchy's catalogs in the language its caller names, and preselects a caller's timezone fallback when geo.omarchy.org can't place the machine. The configurator names the picked language in OMARCHY_FORM_LANGUAGE, the layout that goes with it in OMARCHY_FORM_KEYBOARD_DEFAULT and its country's capital in OMARCHY_FORM_TIMEZONE_FALLBACK. That retires the gum() wrapper that swapped the form's English text for translations and fixed up the keyboard list's --selected, the reverse dictionary behind it in i18n.sh, the form.* keys in every catalog, and the configurator's own geo lookup with its tzupdate stand-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…staller (#299) * Let the setup form translate itself and take its defaults from the installer With omacom/omarchy#16049 the shared setup form reads its strings from Omarchy's catalogs in the language its caller names, and preselects a caller's timezone fallback when geo.omarchy.org can't place the machine. The configurator names the picked language in OMARCHY_FORM_LANGUAGE, the layout that goes with it in OMARCHY_FORM_KEYBOARD_DEFAULT and its country's capital in OMARCHY_FORM_TIMEZONE_FALLBACK. That retires the gum() wrapper that swapped the form's English text for translations and fixed up the keyboard list's --selected, the reverse dictionary behind it in i18n.sh, the form.* keys in every catalog, and the configurator's own geo lookup with its tzupdate stand-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Test what the configurator hands the setup form for a language Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: David Heinemeier Hansson <david@hey.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
) * Let the installer's timezone picker always be searched by typing The timezone prompt used gum choose whenever it had a guess, and gum choose takes no typed text. Since the setup form gained a timezone fallback (#16049) and omarchy-iso passes the language's capital or UTC, there is always a guess, so no installer user can type a city. With Europe/Amsterdam as the guess, typing "tokyo" moves the cursor up on the "k", and Enter then sets Etc/Zulu. The prompt now always opens gum filter, with the guess as the search text. Enter takes the guess, and erasing it searches all zones. In gum 2.0.2 every one of the 598 zones of tzdata 2026e ranks first for its own exact name, so the guess is the highlighted row. --selected is left out on purpose. At limit 1, gum filter prints the --selected entry even after the user searched for another zone and pressed Enter on it. * List the timezone guess first instead of typing it into the search With the guess as the search text, the user had to erase it before searching. Most people start typing straight away. Typing "london" after the guess Europe/Amsterdam searched "Europe/Amsterdamlondon", which matches no zone, so Enter set UTC. The guess now leads the list and the search starts empty. Enter takes the guess, and the first key typed starts a new search of every zone. A guess that is not a zone timedatectl lists is left out, as gum choose --selected ignored one before. The test now checks the guess is the first entry, listed once, and that the call has neither --value nor --selected. * Reject multiline timezone guesses before reordering the list The whole-line membership pattern also matches adjacent lines. A malformed guess with two real zones therefore promotes both, and a guess containing the whole list makes grep return 1 under set -e. Reject embedded newlines before testing membership. Add checks for adjacent zones and the whole list. The adjacent-zone check fails on the previous commit. All 23 setup-form test groups pass in the booted rc2 ISO, and typing Lon then Enter returns Europe/London.
…com#17040) * Let the installer's timezone picker always be searched by typing The timezone prompt used gum choose whenever it had a guess, and gum choose takes no typed text. Since the setup form gained a timezone fallback (omacom#16049) and omarchy-iso passes the language's capital or UTC, there is always a guess, so no installer user can type a city. With Europe/Amsterdam as the guess, typing "tokyo" moves the cursor up on the "k", and Enter then sets Etc/Zulu. The prompt now always opens gum filter, with the guess as the search text. Enter takes the guess, and erasing it searches all zones. In gum 2.0.2 every one of the 598 zones of tzdata 2026e ranks first for its own exact name, so the guess is the highlighted row. --selected is left out on purpose. At limit 1, gum filter prints the --selected entry even after the user searched for another zone and pressed Enter on it. * List the timezone guess first instead of typing it into the search With the guess as the search text, the user had to erase it before searching. Most people start typing straight away. Typing "london" after the guess Europe/Amsterdam searched "Europe/Amsterdamlondon", which matches no zone, so Enter set UTC. The guess now leads the list and the search starts empty. Enter takes the guess, and the first key typed starts a new search of every zone. A guess that is not a zone timedatectl lists is left out, as gum choose --selected ignored one before. The test now checks the guess is the first entry, listed once, and that the call has neither --value nor --selected. * Reject multiline timezone guesses before reordering the list The whole-line membership pattern also matches adjacent lines. A malformed guess with two real zones therefore promotes both, and a guess containing the whole list makes grep return 1 under set -e. Reject embedded newlines before testing membership. Add checks for adjacent zones and the whole list. The adjacent-zone check fails on the previous commit. All 23 setup-form test groups pass in the booted rc2 ISO, and typing Lon then Enter returns Europe/London. (cherry picked from commit 7f4b1dd)
The setup form in
install/provisioning/setup-form.shis shared by the ISO installer and first-boot owner setup. It spoke only English and could only guess a timezone from the network. omacom/omarchy-iso#297 (merged) gave the installer a language picker, and it needs the form to speak that language and fall back to a sensible timezone. Without this, the ISO has to rewrite gum's arguments by matching the form's English text and shadowtzupdatewith a function, so every wording change here silently breaks the ISO.setupForm.*key indefault/i18n/en/cli.json, read throughomarchy_form_textin the language the caller names inOMARCHY_FORM_LANGUAGE. English fills any key a language lacks, and anything that is not a registry code means English.omarchy-i18n, because the live ISO carries the catalogs (they ship in the settings package) but notbin/, and it has no user language file.i18n-test.shcounts the form'somarchy_form_textcalls as references to its keys.OMARCHY_FORM_KEYBOARD_DEFAULTandOMARCHY_FORM_TIMEZONE_DEFAULTfrom Let install media preset the language, keyboard and timezone #15522 stay as they are. A newOMARCHY_FORM_TIMEZONE_FALLBACKis preselected only when the network's guess fails, after the geo.omarchy.org lookup, so the installer can offer the chosen language's capital offline without overriding a working guess.setup-form-test.shcovers the caller's language, the English fallback, a malformed language code, and the fallback's place after the network guess. It now reads this checkout's catalogs rather than the machine's.omacom/omarchy-iso#299 is the ISO side, which sets these variables and drops its interception.
Rebuilt on quattro as a single commit, now that #15522 is merged, on top of the geo.omarchy.org lookup (#16240) and the identity change (#16288). Codex Medium reviewed an earlier version together with the ISO changes. It found the form's translations would have disappeared if only English moved here, so they are carried over. Its agreement is not guaranteed to be independent.