Skip to content

Add a bash fast path for plain omarchy-i18n lookups and fold date calls - #19880

Merged
dhh merged 2 commits into
quattrofrom
faster-i18n-lookup
Nov 23, 2026
Merged

dhh merged 2 commits into
quattrofrom
faster-i18n-lookup

Conversation

@dhh

@dhh dhh commented Nov 23, 2026

Copy link
Copy Markdown
Contributor

What changes

Speeds up bin/omarchy-i18n and bin/omarchy-notification-time by removing unnecessary subprocess forks on the common path:

  • bin/omarchy-i18n: adds a pure-bash fast_lookup for plain, non-plural catalog strings with no numeric arguments or JSON escapes (checking the active language catalog first, then falling back to en/cli.json). Any entry with escapes, empty values, plural objects, --count, --number, or numeric arguments falls through to the existing jq path, keeping behavior identical across every language.
  • bin/omarchy-notification-time: formats day/time, date, and ISO week in a single date +"%A %H:%M%t%d %B %Y%t%V" invocation instead of four separate date calls (preserving single-timestamp atomicity across midnight).

Verification

  • bash test/shell.d/i18n-test.sh — passed (full i18n suite covering plurals, number localization, escapes, fallbacks, and all locales).
  • Benchmarked omarchy-i18n keybindings.title (5 runs): dropped from 15.3ms min (16–18ms typical) to 6.4ms min (zero subprocesses spawned).
  • Verified omarchy-notification-time single-call date formatting produces Monday 09:30 · 23 November 2026 · Week 48.

Screenshots

No visible change: output strings and notifications are identical.

@greptile-apps

greptile-apps Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

Speeds up plain omarchy-i18n lookups and combines the notification’s date calls.

  • Plain translation lookups now skip the jq process.
  • The time notification gets all its date parts from one date call.

Reviews (2) · Last reviewed commit: "Follow Bash conditional style in omarchy..." · Reviewed by Greptile

Comment thread bin/omarchy-i18n Resolved
@omarchybot omarchybot added the enhancement New feature or request label Nov 23, 2026
@dhh
dhh merged commit f8f9fed into quattro Nov 23, 2026
3 checks passed
@dhh
dhh deleted the faster-i18n-lookup branch November 23, 2026 09:00
@emirb emirb added this to the 4.6.0 milestone Dec 1, 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.

3 participants