Repository navigation
Conversation
Omarchy asks for a keyboard layout and derives everything else from it, so LANG stays en_US.UTF-8 until somebody edits /etc/locale.gen by hand and runs locale-gen. There is no locale question at setup (omacom#1187) and no way to change it afterwards short of a terminal (omacom#3161), which leaves a Slovenian desktop of translated applications sitting on an American locale, with English dates and en_US paper sizes. Two additions, both in Omarchy's existing shapes. omarchy-menu-language is omarchy-menu-timezone with localectl in place of timedatectl: list, hand to omarchy-menu-select, apply, notify. It sits at update.language, beside Timezone, where someone looking to change a system setting already goes. The locale name rides along as the picker's subtext, which omarchy-menu-select returns as the stable key, so what comes back is sl_SI.UTF-8 rather than a label. The setup form asks for a language beside the timezone, and configure_language persists it with the rest of the owner's answers. Neither of these translates anything. Setting the system locale is what GTK and Qt applications, browsers and xdg-user-dirs follow; the Omarchy interface stays English, and this takes no position on whether it should ever be anything else. Three details worth a reviewer's eye: omarchy-locale-list reads /usr/share/i18n/SUPPORTED and each locale's own LC_IDENTIFICATION rather than carrying a table, so it tracks whatever glibc ships. Names go through verbatim: about half the entries carry a codeset and half do not, and that first field is both what systemd-localed matches before agreeing to generate a locale and what locale-gen hands to localedef. Rewriting one form into the other breaks it. The setup default is not derived from the keyboard layout, tempting as that is. Layout codes are country codes and locale prefixes are language codes, and they collide: the Slovenian layout is "si", while si_LK is Sinhala. A guess that confident and that wrong is worse than no guess, and filtering for "Slov" costs four keystrokes. configure_language tries systemd-firstboot first and falls back to localectl, which is also what generates a locale nobody has generated yet -- so an owner who does not speak the image's language gets a working locale rather than a named one that does not exist. A locale glibc does not know keeps the default rather than failing setup over a language. Verified: setup-form-test.sh covers the new prompt, its fallback and its Esc/Ctrl+C paths; menu-test.sh passes; the menu file still parses at 321 rows. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JMv63sA2aQLdMTiF2MF5LB
|
This is the piece I had assumed was missing, and it is more careful than I expected — reading The The dependency is worth a word in the comment, because the binary's own strings show how it degrades: "Unable to determine whether /usr/bin/locale-gen exists and is executable, assuming it is not". If either path is missing, Ten languages produce rows a user cannot tell apart. Picking "Serbian (Serbia)" is a coin flip between Cyrillic and Latin, and "Catalan (Spain)" cannot express Valencian at all. Since the ambiguity is exactly the Chinese needs a hint that glibc does not supply. All four Chinese rows carry the bare language name: Simplified and Traditional are different written forms, and nothing on screen says which is which — the user has to already know that Taiwan and Hong Kong are Traditional while China and Singapore are Simplified. glibc disambiguates when it feels like it ( Related, and only worth a sentence: because the list is glibc-complete rather than curated, a user in Taiwan is offered six rows across five languages — Chinese, Mandarin Chinese, Hakka Chinese, Literary Chinese and Min Nan Chinese (twice, One catalog-naming consequence for whoever ends up owning the message catalogs, since this PR decides which Happy to send the |
@linyiru checked the claim that localectl generates a locale nobody has generated yet, confirmed it on Arch, and pointed out that the dependency belongs in the comment: systemd-localed only does this when /usr/bin/locale-gen and /etc/locale.gen are both present. Without them set-locale still succeeds and writes /etc/locale.conf, and the locale is never generated -- LANG then names something that falls back to C, with nothing failing along the way. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01JMv63sA2aQLdMTiF2MF5LB
|
@linyiru This is the most useful review I've had — thank you for running it The Yes please to the One implementation note, since it decides where the fix goes. Three things On the Chinese script hint: a table keyed by locale name is the only thing that The catalog-naming point lands outside this PR but I will act on it: I maintain The six-rows-for-Taiwan observation I am going to leave alone deliberately. The |
|
Sent: sbelcl#1, against It went the way you guessed. Both gaps are one qualifier slot fed from two sources, the modifier read off the locale name and a four-entry table for the written form 🤖 Generated with Claude Code |
The setup form's prompts are tested against stubs for everything they reach for -- gum, tzupdate, timedatectl -- except the language prompt, which ran the real omarchy-locale-list and so read the host's /usr/share/i18n. That is absent anywhere but Arch, where the list comes back empty and the language assertions fail, and it is a list that moves with glibc everywhere else. Stub it like the rest. The assertions that matter are about the prompt, not about which locales the box building it happens to ship, and pinning the list is what lets them name a locale on purpose: the pair that only an @modifier tells apart is the case worth testing, and asserting it against the host would be asserting that glibc still ships sr_RS@latin. $ROOT/bin was on PATH for that one command and comes back off.
omarchy-locale-list names a locale by its language and territory, and ten of glibc's 327 UTF-8 locales share both with another. The difference is the @modifier the label drops, so the setup form showed "Serbian (Serbia)" on two rows, and matching the chosen label back against a rebuilt one took the first row that matched: all ten modifier-bearing locales were unreachable there, and picking Catalan could not reach Valencian at all. The menu fared better only because it carries the locale name as subtext, which is a name, not an answer. Chinese is ambiguous for a different reason. All four of its locales call their language "Chinese", and nothing on screen said which of Simplified and Traditional a territory implies, so the user had to already know that Taiwan and Hong Kong are Traditional while China and Singapore are not. Both are one shape: the label drops a distinction the locale name keeps. So both go in one qualifier slot -- "Serbian (Serbia, Latin)", "Chinese (Taiwan, Traditional)" -- fed from the two places the distinction can come from. The modifier is read off the name. The script cannot be read off anything: LC_IDENTIFICATION has no script field, so those four are a table, and it stays four entries long because no other language on the list is written two ways. A modifier is appended only where the label is shared, leaving the 313 rows that already name one locale as short as they were. Every modifier-bearing locale glibc ships today does share its label, so today the two rules pick the same rows; the test is the ambiguity rather than the modifier so that a future locale which is the only one of its language and territory keeps the shorter label. The label is a fourth field rather than something each caller builds, because uniqueness is not a property of a row: it depends on the rest of the list, which the caller formatting one row does not have. Both callers were already rebuilding the same label from fields 2 and 3, and the setup form was matching the user's choice against a third rebuild of it. Reading field 4 makes that lookup single-valued and hands the same disambiguation to anything else that lists locales. Measured on glibc 2.44: 327 rows before and after, fields 1 to 3 byte-for-byte unchanged, 14 labels qualified, and now 327 distinct labels where there were 317.
|
| systemd-firstboot --locale="$language" --force 2>&1 || | ||
| localectl set-locale "LANG=$language" 2>&1 || |
There was a problem hiding this comment.
Selected locale remains ungenerated
If the owner selects a locale that has not already been generated, systemd-firstboot --locale can successfully write /etc/locale.conf without generating it. That success skips localectl, so the next login sets LANG to a locale glibc cannot load and the setup choice does not take effect. Generate the locale on the successful firstboot path too.
There was a problem hiding this comment.
This doesn't happen: systemd-firstboot --locale refuses a locale that hasn't been generated, so the localectl fallback does run, and localectl generates it.
Measured in a booted Arch container (systemd-nspawn on a fresh pacstrap base), running this exact configure_language with an ungenerated de_DE.UTF-8:
systemd-firstboot: Locale de_DE.UTF-8 is not installed.
/etc/locale.conf: LANG=de_DE.UTF-8
/etc/locale.gen: de_DE.UTF-8 UTF-8 (uncommented)
locale -a: de_DE.utf8
I first took this finding at face value and pushed 841a5bc to reorder the calls; that's reverted in d92975b. 8d81af0 adds the sentence the comment was missing — that firstboot's refusal is what hands over to localectl — and a test that pins it.
There was a problem hiding this comment.
You’re right — with an ungenerated locale, systemd-firstboot --locale exits non-zero (Locale ... is not installed), so the || localectl set-locale ... fallback runs and generates/persists it. The measured de_DE.UTF-8 result and regression test confirm that the successful-firstboot path I was concerned about does not occur here. This finding is invalid; the updated comment now documents the handoff correctly.
Tip: You can customize Greptile's behavior for this repo with .greptile/rules.md and .greptile/config.json.
| @@ -209,6 +227,58 @@ assert_status "$OMARCHY_FORM_BACK" "hostname prompt reports Esc as back" | |||
| assert_returned "hostname prompt survives Esc under set -e" | |||
There was a problem hiding this comment.
Locale application remains untested
These tests check that the prompt resolves a selected label, but never exercise configure_language with an ungenerated locale. They therefore pass even if setup records the locale name without generating it. Add a provisioning-path test that checks both the saved setting and locale generation.
There was a problem hiding this comment.
Covered now by test/shell.d/provision-language-test.sh (8d81af0). It runs the real configure_language against stubs: systemd-firstboot alone for a generated locale, localectl when firstboot refuses an ungenerated one, a logged failure when neither can, and nothing for a locale glibc doesn't list. The real-system behaviour it stands in for is in the reply on omarchy-provision-owner.
configure_language ran systemd-firstboot first and localectl only if that failed. firstboot only writes /etc/locale.conf, and it does not fail, so localectl -- the call that generates a locale, since systemd-localed is built with locale-gen support -- never ran. Every language but the image's own came out named in locale.conf and generated nowhere, and the session fell back to C. The comment above it said the opposite. localectl now goes first, the same call omarchy-menu-language makes. systemd-firstboot stays as the fallback for a boot where localed cannot be reached, and logs that the locale it recorded was not generated. test/shell.d/provision-language-test.sh runs the real configure_language against stubs: localectl alone for a known locale, firstboot only when it fails, a logged failure when neither can, and nothing for a locale glibc does not list. It fails on the previous order. Co-Authored-By: Claude Opus 5.5 <[email protected]>
This reverts commit 841a5bc. Its premise was wrong. It assumed systemd-firstboot --locale always succeeds, so the localectl fallback -- the call that generates a locale -- never ran. Measured in a booted Arch container (systemd-nspawn, fresh pacstrap base), the code before it did this with an ungenerated de_DE.UTF-8: systemd-firstboot refused: "Locale de_DE.UTF-8 is not installed." localectl set-locale ran as the fallback /etc/locale.gen: de_DE.UTF-8 uncommented; locale -a: de_DE.utf8 So firstboot fails exactly when a locale has not been generated, and the fallback generates it. The original order was correct; the reverted commit's message, comment and fallback log line described a case that does not happen. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The comment named localectl as the fallback and as what generates a new locale, but not what makes the fallback run, which is the part a reader needs: systemd-firstboot refuses a locale that has not been generated yet. Without that sentence the order reads as a bug -- a review bot read it that way, and so did the commit just reverted. test/shell.d/provision-language-test.sh runs the real configure_language against stubs: systemd-firstboot alone for a generated locale, localectl when firstboot refuses an ungenerated one, a logged failure when neither can, and nothing for a locale glibc does not list. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
I checked the Korean path on 8d81af0. Arch Linux ARM, glibc 2.43, xdg-user-dirs 0.20, with
Korean comes through as a single unambiguous row, and dates follow the chosen locale. The setup path leaves two sets of folders: How I measuredlocaledef -i ko_KR -f UTF-8 $W/loc/ko_KR.UTF-8
localedef -i en_US -f UTF-8 $W/loc/en_US.UTF-8
export LOCPATH=$W/loc
TZ=Asia/Seoul LANG=ko_KR.UTF-8 date -d '2026-10-07 15:04:05'
TZ=Asia/Seoul LANG=ko_KR.UTF-8 date -d '2026-10-07 15:04:05' '+%x %X'
OMARCHY_I18N_PATH=/usr/share/i18n omarchy-locale-list | awk -F'\t' '$1 ~ /^ko_/'
# setup path: the provision-user steps under en_US (same result under C.UTF-8), then a login run under ko_KR
H=$W/h1; mkdir -p $H/Downloads $H/Pictures $H/Videos
for k in TEMPLATES PUBLICSHARE DESKTOP; do
env -i PATH=/usr/bin HOME=$H LOCPATH=$W/loc LANG=en_US.UTF-8 xdg-user-dirs-update --set $k "$H"
done
env -i PATH=/usr/bin HOME=$H LOCPATH=$W/loc LANG=ko_KR.UTF-8 xdg-user-dirs-update
ls $H; cat $H/.config/user-dirs.dirs
# menu path: full run under en_US, then ko_KR
H=$W/h2; mkdir -p $H
env -i PATH=/usr/bin HOME=$H LOCPATH=$W/loc LANG=en_US.UTF-8 xdg-user-dirs-update
env -i PATH=/usr/bin HOME=$H LOCPATH=$W/loc LANG=ko_KR.UTF-8 xdg-user-dirs-updateI called |
|
The locale-list / localectl approach looks solid (and the ko_KR check is nice). Needs a rebase — CONFLICTING against current |
Omarchy asks for a keyboard layout and derives everything else from it, so
LANGstaysen_US.UTF-8until somebody edits/etc/locale.genby hand andruns
locale-gen. There is no locale question at setup (#1187) and no way tochange it afterwards short of a terminal (#3161). A Slovenian desktop ends up
as translated applications sitting on an American locale — English dates,
Letter paper,
1,234.56.Two additions, both in shapes that already exist here.
omarchy-menu-languageisomarchy-menu-timezonewithlocalectlinplace of
timedatectl: list, hand toomarchy-menu-select, apply, notify. Itsits at
update.language, beside Timezone, where someone changing a systemsetting already goes. The locale name rides along as the picker's subtext,
which
omarchy-menu-selecthands back as the stable key, so what comes backis
sl_SI.UTF-8rather than a label.The setup form asks for a language beside the timezone, and
configure_languagepersists it with the rest of the owner's answers.This does not translate anything
Setting the system locale is what GTK and Qt applications, browsers and
xdg-user-dirsfollow. The Omarchy interface stays English, and this PR takesno position on whether it ever should be otherwise —
shell/plugins/panels/clock/Panel.qmlsays the interface is Englishthroughout, and nothing here disagrees with that.
Three details worth a reviewer's eye
Locale names go through verbatim.
omarchy-locale-listreads/usr/share/i18n/SUPPORTEDand each locale's ownLC_IDENTIFICATIONratherthan carrying a table, so it tracks whatever glibc ships. About half the
entries carry a codeset (
en_US.UTF-8) and half do not (aa_ER,be_BY@latin), and that first field is both whatsystemd-localedmatchesbefore agreeing to generate a locale and what
locale-genhands tolocaledef. Rewriting one form into the other breaks it.The setup default is not derived from the keyboard layout, tempting as
that is. Layout codes are country codes and locale prefixes are language
codes, and they collide: the Slovenian layout is
si, whilesi_LKisSinhala. I built that heuristic first and it confidently suggested Sinhala for
a Slovenian keyboard. A guess that wrong is worse than no guess, and filtering
for "Slov" costs four keystrokes.
configure_languagetriessystemd-firstbootfirst and falls back tolocalectl, which is also what generates a locale nobody has generated yet— so an owner who does not speak the image's language gets a working locale
rather than a named one that does not exist. A locale glibc does not know
keeps the default rather than failing setup over a language.
Testing
setup-form-test.shcovers the new prompt, its fallback and its Esc/Ctrl+Cpaths;
menu-test.shpasses; the menu file still parses. The picker and themenu row have been exercised on a running 4.0.2 desktop, switching that
machine to
sl_SI.UTF-8and back.Related but deliberately not in this PR: #7284 asks for a translation layer
for the shell's own strings, which is a much larger question and touches the
English-throughout decision directly. There's a prototype for that on a
separate branch, and it is not needed for any of the above.
🤖 Generated with Claude Code
https://claude.ai/code/session_01JMv63sA2aQLdMTiF2MF5LB