codeburn/mac/Sources/CodeBurnMenubar
ozymandiashh d62857ea4e feat(menubar): route every user-facing string through a strings catalog
Groundwork for #1219. The menubar app hardcoded ~530 English strings across
Views/, the presentation structs, the status-item menu and the update alerts,
so there was nothing for a translator to translate.

Every user-facing literal now goes through `L(_:)` / `L(_:_:)`, which look the
string up in `Localizable.strings` in the SwiftPM target resource bundle. The
key *is* the English copy, so English stays the development language and a
missing translation degrades to correct English instead of a dotted
identifier. `en.lproj` is therefore an identity table; it exists so the bundle
advertises `en` and so a translation can be diffed against it.

Why the lookups are explicit rather than relying on SwiftUI's implicit
`LocalizedStringKey`: SwiftPM emits target resources into a sibling bundle
(`CodeBurnMenubar_CodeBurnMenubar.bundle`) that the packaging scripts copy into
`Contents/Resources`. `Bundle.main` has no `.lproj` at all, so `Text("literal")`
would always miss. Naming `Bundle.module` is the one form that resolves the
same way in `swift run`, in `swift test` and in the packaged `.app`.

Enum raw values that double as identity (`Period`, `MenubarScope`,
`InsightMode`, `AccentPreset`, `ProviderFilter`) keep their raw value and gain
a `displayLabel`, so persistence and cache keys are untouched by translation.

Three display-only date formatters that were pinned to `en_US_POSIX` with fixed
patterns now use `setLocalizedDateFormatFromTemplate`, and the calendar
popover's weekday row comes from the locale's own symbols. The `yyyy-MM-dd`
formatter stays POSIX: it parses and builds data keys, not display text.

Not extracted, deliberately: provider, model and plan names; units; currency
codes; shell commands and paths; quota window labels that policy code matches
on by English substring (`QuotaSummary.headlineWindow`); and anything the
`codeburn` CLI produces.

Also copies the SwiftPM resource bundle into the app in build-local.sh, using
the named-bundle + `[[ -d ]]` pattern package-app.sh already uses. Without it
the assembled app finds no strings table (and already trapped on first icon
load, the resource-bundle half of #1262).
2026-09-12 15:21:49 -07:00
..
Data feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
Resources feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
Security feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
Theme feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
Views feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
AppStore.swift feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
AppVersion.swift Normalize menubar version display 2026-05-11 11:21:39 -07:00
CapacityDockController.swift feat(mac): tell the user when a quota reset came early 2026-09-12 14:58:42 -07:00
CapacityDockMotion.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
CapacityDockPlacement.swift fix(menubar): keep Capacity Dock hover alive after app deactivation (#1170) 2026-08-29 18:42:27 +02:00
CapacityDockPointerUpdateCoalescer.swift Fix Capacity Dock pointer coalescing and dismissal 2026-09-01 16:51:00 +05:30
CodeBurnApp.swift feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
CurrencyState.swift perf(desktop): share cache state and eliminate duplicate cold hydration 2026-08-12 17:16:41 +03:00
Localization.swift feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
MenubarScope.swift feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
MenubarSecondRow.swift fix(menubar): pick the second row's provider by its worst quota window 2026-09-12 20:29:35 +03:00
ProviderIcon.swift feat(menubar): add native Capacity Dock (#1167) 2026-08-29 00:37:30 -07:00
QuotaRefreshDecision.swift fix(mac): keep dock quota fresh when the payload tick is skipped 2026-09-12 03:47:46 -07:00
RefreshCadence.swift menubar: skip unchanged background refreshes, 120s AC idle cadence, utility QoS for tick spawns (#703) (#704) 2026-07-16 15:11:25 -07:00
SessionCountLabel.swift feat(menubar): route every user-facing string through a strings catalog 2026-09-12 15:21:49 -07:00
StatusItemContextMenuPolicy.swift test(mac): lock status-item context menu policy (#802) 2026-07-24 19:27:25 +07:00
StatusItemPlacementPolicy.swift fix(menubar): recover parked status item (#1161) 2026-08-28 13:20:48 -07:00