<#1040 Complete locale formatting and page titles ...
# osctrl
g
#1040 Complete locale formatting and page titles across all 13 languages Pull request opened by javuto Complete locale formatting and page titles across all 13 languages (i18n phase 4) Problem Time/number/date rendering across feature pages was still hardcoded to `en-US`/`toLocaleString()`, and all 24 browser-tab page titles were English-only — inconsistent with the translated chrome and catalogs. Change • Locale formatting fully migrated: every remaining
toLocaleString()
/
toLocaleDateString()
/
toLocaleTimeString()
/
Intl.DateTimeFormat("en-US")
call site now follows the active language: • Dashboard (~20 sites): KPI values, workload progress ("2,481 of 3,500 responses"), platform totals, error dialog, endpoint health, environments table, osquery versions, active queries, timestamps • ActivityLineChart tooltip formatters → active locale tag • NodesTable filter counts, NodeDetail bytes + error plural, Users token expiry, Health runtime values + "as of", FilterChip counts, file-explorer unix timestamps • ICU plurals: NodeDetail error counts use
{count, plural, ...}
with full category support — e.g. Russian "1 ошибка / 2 ошибки / 5 ошибок" and Polish "1 błąd / 2 błędy / 5 błędów", not just one/other. • All 24 page titles translated: every
usePageTitle()
call resolves through
pageTitle.*
keys localized in all 13 languages. • New shared helpers in `useLocale`:
formatLocaleNumber
,
formatLocaleDateTime
, and
activeLocaleTag
for plain-module (non-hook) call sites like table formatters — sharing the same per-locale formatter cache, so no new cost. Performance • No new runtime dependencies; Intl formatter cache reuse means hot table paths (thousands of rows) never rebuild formatters. • Lazy locale chunks: 12 (2.2–2.8 KB gz each), English bundled. Main bundle unchanged from phase 3 (~357 KB gz). Validation •
npm run check
— clean •
npm test
— 362 passed (2 assertions updated to match translated output; ICU plural + locale formatting covered by existing suites) •
npm run build
— all chunks emitted correctly • Verified zero remaining hardcoded locale calls outside the locale-aware
time.ts
helper Remaining (explicitly out of scope) Long-form descriptive copy inside feature pages (panel descriptions, empty states, dialog prose — ~1,400 strings across 19 feature areas) remains English and is best migrated incrementally per feature in follow-up PRs using the established pattern. All infrastructure, chrome, navigation, login, command palette, page titles, and number/date/time formatting are fully multilingual. jmpsec/osctrl