Introducing a new way to review your PRs.

Read the announcement

omacom / omarchy

Beautiful, Modern & Opinionated Linux

View on GitHub

29 documents · Updated Nov 23, 2026

docs / locale-setup-and-translation-runtime

Locale setup and translation runtime

Omarchy separates the language of its interface from the regional rules used for dates, numbers, money, units, and paper sizes. A small registry connects user choices to translation catalogs, generated system locales, and session environment values. The shell, menu, setup form, and command notifications then use the same language choice while keeping stable command and data values in English.

This page describes the runtime part of localization and language experience.

Locale selection

Locale registry

The locale registry is the shared source for supported language choices. Each language code maps to its display names, a BCP 47 format locale for UI formatting, and a glibc UTF-8 locale for system programs. It can also define text direction, decimal marks, and native digits. default/…/regions.json adds regional format choices that do not change the interface language.

The language choice is stored as one registry code in the user's Omarchy configuration. An absent or unknown value resolves to English. A region choice can instead name a regional English locale or the locale associated with a language. The region picker uses default/…/format-samples.json to show the effect of a choice before that locale exists on the system.

References: default/…/locales.json• L2-25 default/…/regions.json• L1-26 default/…/format-samples.json• L1-56 bin/omarchy-language• L9-42 bin/omarchy-region• L9-60

Locale generation and session activation

Selecting a language or region first checks whether its glibc locale already exists. If it does not, the shared locale-session helper invokes the privileged generator with the registry code. The helper uses the available authorization path for the caller, including a passwordless grant, a terminal prompt, or graphical authentication.

The choice is written only after generation succeeds, so a cancelled authentication step does not leave a choice that the system cannot use. The language writes LANG to the user's uwsm environment for later logins. The region writes only the format categories for dates, numbers, money, measurements, and paper size. These files are ordered so the region values override the language locale for those categories while LANG and message language remain with the language choice.

The running desktop receives new values without a full login. The shared helper passes each new value to the desktop session and restarts the shell so newly launched shell processes inherit it. Existing applications keep the environment from their launch, while new applications inherit the updated session values. The interface itself watches the language file and can update without waiting for that application restart.

The following flow shows the common path from a user choice to later application behavior.

flowchart LR
    Choice[Language or region choice] --> Registry[Locale registry]
    Registry --> Generate[Generate glibc locale if needed]
    Generate --> Persist[Persist language or format environment]
    Persist --> Session[Update running desktop session]
    Persist --> Login[Export values at next login]
    Session --> NewApps[New applications use the choice]
    Session --> Interface[Shell and menu re-render]

References: bin/omarchy-locale-generate• L20-72 bin/omarchy-locale-session• L9-71 bin/omarchy-language• L57-108 bin/omarchy-region• L15-97

Initial system locale

The install locale step provides a safe UTF-8 baseline for images that start with an unset LANG, C, or POSIX. It repairs only that stock state and leaves a named locale and separately set LC_* values alone. This bootstrap step is separate from a user's later Omarchy language and region choices.

References: install/…/locale.sh• L1-50 test/…/locale-setup-test.sh• L50-117

Translation catalogs

Catalog layers and fallback

The English catalogs under default/i18n/en/ define the supported translation units. They cover shell text, command and notification text, menu labels and descriptions, and keybinding descriptions. Each non-English language has a matching directory with the same catalog roles. A catalog value is normally a string; count-sensitive text is an object whose keys are plural categories.

Runtime consumers layer the selected catalog over English. A missing or empty translated value therefore falls back to the English value instead of exposing a missing translation. Placeholders such as %1 stay part of the catalog value so a language can change word order without changing the caller's data.

References: default/…/shell.json• L1-30 default/…/cli.json• L1-18 shell/…/I18n.qml• L7-15 shell/…/I18n.qml• L30-58 test/…/i18n-test.sh• L54-83

Translation manifest

The translation manifest records which English source each translated unit used. Its unit names identify the catalog family or manual chapter, such as cli:<key>, menu:<id>.<field>, shell:<key>, keybindings:<text>, and manual:<file>. The value is a short source hash rather than the translated text.

The sync process compares these hashes with the current English sources. A missing translation or a changed English source becomes pending work. This lets English changes ship first while still showing which languages need new text, and it lets the sync process validate and update only affected units.

References: default/…/translation-manifest.json• L1-15 scripts/i18n-sync.py• L15-19 scripts/i18n-sync.py• L106-160

Translation consumers

Shell consumption

The shell's i18n service is the live bridge between the selected language and Quickshell text. It watches the user's language file, the English shell catalog, the selected catalog, and the locale registry. Shell bindings use translated strings and plural forms, while the registry's format locale and number rules keep displayed dates and numbers consistent with the language.

Shell extensions can use the same language through a separate catalog directory. That service falls back from a regional language such as pt-BR to its base language, then to English. This allows a plugin to add translations in stages without changing the shell's main catalogs.

References: shell/…/I18n.qml• L19-28 shell/…/I18n.qml• L30-65 shell/…/I18n.qml• L82-101 shell/…/Translations.qml• L4-19 shell/…/Translations.qml• L26-59

The menu catalog changes what users see without changing how menu actions are addressed. The menu model applies translated labels, titles, and descriptions to shipped rows before user menu entries are merged. When a label changes language, its English label remains searchable but does not become a new route. User retitles and user rows keep their precedence.

This split protects menu commands and stored identifiers from translation changes. It also lets an incomplete catalog degrade one row at a time to English.

References: shell/…/MenuModel.js• L681-715 shell/…/MenuModel.js• L89-123 test/…/i18n-test.sh• L133-162

Command consumption

The command surface uses omarchy-i18n to turn a stable key into user-facing text. It selects the stored language, checks that language's CLI catalog, falls back to English, and then substitutes positional values. It can also select plural forms and format numeric arguments with the registry's decimal mark and digit set.

The setup form uses the same CLI catalog family before a user account and language file exist. Its caller supplies a temporary form language. If the console cannot display that language, the form shows English while still allowing the user to choose the language that will become the desktop language.

References: bin/omarchy-i18n• L9-20 bin/omarchy-i18n• L47-85 install/…/setup-form.sh• L25-35 install/…/setup-form.sh• L143-213

Regional formatting

Format categories

Language and region choices affect different parts of the process. The language sets the general session locale and interface messages. The region overrides only the categories that describe how values are written, so an English interface can use Danish or British formats without changing its words.

The format preview is data from the same glibc locale family used at runtime. The registry also supplies shell-specific decimal and digit settings, while right-to-left languages supply a direction flag that the shell uses for layout mirroring.

References: bin/omarchy-region• L15-26 default/…/locales.json• L18-25 shell/…/I18n.qml• L22-28 default/…/format-samples.json• L1-8

Change checklist

When these files or sections are changed, remember to consider these:

  • Add a language or region to every registry and preview source that the picker reads. The locale generator and sudo rule must accept the same code.
  • Keep the language environment and region environment ordered. A region must override only format categories and must not replace LANG or message language.
  • Keep English catalog keys aligned with their consumers. A menu row, shell key, or command key can silently fall back to English when its catalog entry is missing.
  • Preserve %1-style placeholders and plural categories across translated catalogs. The manifest must record the new English source hash after a translation update.
  • Keep display labels separate from stable menu routes and stored values. A translated label must remain searchable without becoming a new command route.

Important failure modes

TriggerConsequenceGuard
A language or region code is added to a picker but not to the locale registry or generator inputsThe user can select a choice that cannot be generated or activatedUse the shared registry and validate the code before persistence
Locale generation fails or authentication is cancelledThe requested choice is not stored, so the old working choice remainsPersist the choice only after the locale exists
A region file sets LANG or LC_MESSAGESThe interface language changes with the format choiceRestrict region activation to the five format categories
A catalog key or placeholder changes without updating its consumersA row falls back to English or displays incorrect substituted textKeep English catalogs, callers, and manifest hashes in sync
A translated menu label is used as a routeMenu commands change when the display language changesKeep English labels in search-only terms and resolve routes by stable IDs

Key files

FileWhy to read it
default/…/locales.jsonDefines language metadata, system locales, number rules, and text direction.
default/…/regions.jsonDefines regional format choices that are independent of interface language.
default/i18n/en/Defines the English catalog shape and source text for each runtime surface.
default/…/translation-manifest.jsonTracks the English source version used by each translation unit.
bin/omarchy-languageShows how language selection persists and reaches the session.
bin/omarchy-regionShows how regional format selection differs from language selection.
bin/omarchy-locale-sessionProvides the shared locale-generation and running-session handoff.
shell/Commons/I18n.qmlShows how the shell loads, falls back, and re-renders translations.
shell/…/MenuModel.jsShows how menu translations preserve stable routing and search.
bin/omarchy-i18nShows how command text, placeholders, plurals, and numbers are produced.
install/…/setup-form.shShows how setup prompts use catalogs before the desktop session exists.
scripts/i18n-sync.pyShows how source hashes turn catalog changes into translation work.