Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion bin/omarchy-locale-generate
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,12 @@ fi
# The code only selects a locale from the registries; nothing the caller
# passes reaches locale.gen or localedef itself. An installed package older
# than the region registry, under a dev checkout's helper, has only languages.
# The country part is optional because Esperanto has no country: glibc ships it
# as plain eo.UTF-8.
[[ -e $regions ]] || regions=/dev/null
locale=$(jq -nr --arg code "$code" --slurpfile languages "$registry" --slurpfile regions "$regions" \
'($languages[0] + ($regions[0] // {}))[$code].locale // empty')
if [[ ! $locale =~ ^[a-z]{2,3}_[A-Z]{2}\.UTF-8$ ]]; then
if [[ ! $locale =~ ^[a-z]{2,3}(_[A-Z]{2})?\.UTF-8$ ]]; then
echo "Unknown language or region code: $code" >&2
exit 1
fi
Expand Down
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy-make-app/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ README.md LICENSE .gitignore

- **Follow the theme live, all of it.** The template `Theme` reads the whole palette from `~/.local/state/omarchy/current/theme/colors.toml`, not only the accent: `accent`, `background`, and `foreground` as properties, and every other key in `theme.colors` (`theme.colors.selection`, `theme.colors.red`). Themes are light as well as dark, so the window takes `theme.background` and `Material.theme: theme.light ? Material.Light : Material.Dark` rather than a hard-coded dark color, and anything drawn on the accent uses `theme.accentForeground`, since a fixed white label is unreadable on a light accent. Theme files write colors quoted, bare, or with a trailing comment, and `readThemeColors()` takes all three. A theme switch replaces files and symlinks, so the watcher re-arms on every change, and watching the nearest existing ancestor means installing Omarchy later works without a restart. Without Omarchy it falls back to a dark palette with `#FFD60A`. Never change Omarchy's config.
- **React to events, never poll.** Omarchy's `AGENTS.md` asks long-running code to react to events rather than poll with a timer. Hyprland's rounding has an event: the template `Theme` asks `hyprctl` on start and again whenever Hyprland's event socket announces `configreloaded`, which it sends once new values are in effect, the same way Omarchy's own shell follows it; if the socket drops, it reconnects and asks again. Do the same for anything else the app follows, and where a poll is truly the only way, stop it while the window is inactive.
- **Speak the user's language.** Omarchy runs in 50 languages, and the app follows the one picked under Setup > Region > Language, live, like the theme. Write every visible string as `qsTr("Save")` in QML or `tr("Save")` in C++, with `%1` placeholders filled by `.arg()` rather than sentences glued together, and a counted string as `qsTr("%Ln clips", "", count)` so each language gets its own plural forms and digits. Ship translations as `src/i18n/<code>.json` (English text to translation) compiled into the binary, with `en.json` listing every string the app translates, so translators have one file to work from and the tests can tell when a string is missing. The template `Translator` is the one every app carries: it reads `~/.config/omarchy/language`, falls back from `pt-BR` to `pt` to English per string, and sets the default `QLocale` and layout direction from Omarchy's registry. Write numbers and dates through `Qt.locale()` (`value.toLocaleString(Qt.locale(), 'f', 1)`), and keep the window's content under the template's mirrored root so Arabic, Hebrew, Persian, and Urdu read right to left. A binding that formats a date or number reads `translator.language` so it re-renders on a switch. Translate the `.desktop` file's `Name` and `Comment` too (`Name[da]=…`). Keep brand names, units, and keyboard keys as they are. A label with an access key (`qsTr("&Save")`) keeps one in every translation, distinct from the others in its dialog. Folio's `scripts/i18n-sync.py` and its workflow keep 49 catalogs in step with `en.json`.
- **Speak the user's language.** Omarchy runs in 51 languages, and the app follows the one picked under Setup > Region > Language, live, like the theme. Write every visible string as `qsTr("Save")` in QML or `tr("Save")` in C++, with `%1` placeholders filled by `.arg()` rather than sentences glued together, and a counted string as `qsTr("%Ln clips", "", count)` so each language gets its own plural forms and digits. Ship translations as `src/i18n/<code>.json` (English text to translation) compiled into the binary, with `en.json` listing every string the app translates, so translators have one file to work from and the tests can tell when a string is missing. The template `Translator` is the one every app carries: it reads `~/.config/omarchy/language`, falls back from `pt-BR` to `pt` to English per string, and sets the default `QLocale` and layout direction from Omarchy's registry. Write numbers and dates through `Qt.locale()` (`value.toLocaleString(Qt.locale(), 'f', 1)`), and keep the window's content under the template's mirrored root so Arabic, Hebrew, Persian, and Urdu read right to left. A binding that formats a date or number reads `translator.language` so it re-renders on a switch. Translate the `.desktop` file's `Name` and `Comment` too (`Name[da]=…`). Keep brand names, units, and keyboard keys as they are. A label with an access key (`qsTr("&Save")`) keeps one in every translation, distinct from the others in its dialog. Folio's `scripts/i18n-sync.py` and its workflow keep 50 catalogs in step with `en.json`.
- **Corners match the windows.** Hyprland's `decoration:rounding` is 0 on Omarchy's default, so corners are sharp unless the theme or the user rounds windows. Use `theme.radius` for every panel, dialog, and button, and cap small elements with `Math.min(4, theme.radius)`. Only true circles keep a fixed radius. A Material control takes it as `Material.roundedScale: theme.radius`, set on each control rather than once on the window, because it isn't inherited. It is an enumeration, so it takes that binding but rejects a literal number: `Material.roundedScale: 6` stops the file from loading.
- **Text follows the desktop's size.** `omarchy display text size` sets the shell's `[font] base-size` in `~/.config/omarchy/shell.toml` (12 px by default, over the theme's own `shell.toml`) and GNOME's `text-scaling-factor` together. An app that is mostly text scales its type from one of them, live: Plain's `Theme` reads `base-size` as `textSize`, and Omacalc and Omawrite follow `text-scaling-factor` through the settings portal.
- **Place things where the pointer is.** Anything the user inserts lands under the mouse when it's over the content (a `HoverHandler` tracks it), and in the middle of what's visible otherwise. Never at a fixed corner.
Expand Down
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy-make-app/templates.md
Original file line number Diff line number Diff line change
Expand Up @@ -904,7 +904,7 @@ List one `<file>` line per catalog in `src/i18n/`.

## `src/i18n/en.json` and `src/i18n/<code>.json`

One flat JSON object per language, keyed by the English exactly as it appears in `qsTr()`, with Omarchy's language codes as file names (`$OMARCHY_PATH/default/i18n/locales.json` lists all 50: `da`, `de`, `pt-BR`, `zh-CN`, ...). `en.json` lists every string the app translates, each as itself, which is what translators and the tests work from. Keep `%1` placeholders, which `.arg()` fills, so a translation can reorder them. A counted string's value is an object of plural forms keyed by CLDR category: English gives `one` and `other`, and each language the categories it uses (Russian `one`, `few`, `many`, `other`; Arabic six; Japanese only `other`; `Translator::pluralCategory` lists them).
One flat JSON object per language, keyed by the English exactly as it appears in `qsTr()`, with Omarchy's language codes as file names (`$OMARCHY_PATH/default/i18n/locales.json` lists all 51: `da`, `de`, `pt-BR`, `zh-CN`, ...). `en.json` lists every string the app translates, each as itself, which is what translators and the tests work from. Keep `%1` placeholders, which `.arg()` fills, so a translation can reorder them. A counted string's value is an object of plural forms keyed by CLDR category: English gives `one` and `other`, and each language the categories it uses (Russian `one`, `few`, `many`, `other`; Arabic six; Japanese only `other`; `Translator::pluralCategory` lists them).

```json
{
Expand Down
2 changes: 1 addition & 1 deletion default/agents/skills/omarchy-make-plugin/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ Item {

## Translations

Omarchy runs in 50 languages, and a plugin should follow the one picked under Setup > Region > Language the way the built-in plugins do: live, without a shell restart. Ship the plugin's strings as flat JSON catalogs in an `i18n/` directory beside its QML, one file per Omarchy language code (`en.json`, `da.json`, `pt-BR.json`; `$OMARCHY_PATH/default/i18n/locales.json` lists all 50), and read them through `Commons.Translations`:
Omarchy runs in 51 languages, and a plugin should follow the one picked under Setup > Region > Language the way the built-in plugins do: live, without a shell restart. Ship the plugin's strings as flat JSON catalogs in an `i18n/` directory beside its QML, one file per Omarchy language code (`en.json`, `da.json`, `pt-BR.json`; `$OMARCHY_PATH/default/i18n/locales.json` lists all 51), and read them through `Commons.Translations`:

```qml
import qs.Commons as Commons
Expand Down
Loading