Skip to content

Docs

Localization

Where the strings of OSAGI Console live, how dates, numbers and money are formatted, and how to add a language without an i18n framework.

The console ships in English. There is no i18n framework on purpose: strings are plain TypeScript, so a translation changes files, not the architecture.

Where the strings live

StringsWhere
Shell, navigation, chat and docs textsThe dictionary in lib/i18n
Texts of a module screenNext to its components and view models (components/<module>, lib/<module>)
Permission labelslib/auth/perms.ts
Demo datalib/mock/fixtures/* and lib/mock/snapshots/*
These docs pagesThe docs store, seeded from lib/mock/fixtures/docs.ts

Dates, numbers and money

  • Numbers and dates go through Intl with the en-US locale: 1,284, $1,284, Oct 14, 2026, times on a 24-hour clock (14:32).
  • date-fns formats with its enUS locale.
  • One time zone serves the report screens, the overview and the freshness badges: set NEXT_PUBLIC_REPORT_TIME_ZONE at build time to an IANA name (Asia/Dubai, America/Bogota); unset or unknown means UTC. lib/config/time.ts reads it into REPORT_TIME_ZONE and derives REPORT_UTC_OFFSET; lib/modules/shared.ts re-exports both next to REPORT_LOCALE. Report producers write timestamps without a zone and report days are counted with one fixed offset, so a zone whose offset changed or changes on any day since 2000 (daylight saving time in Europe/Berlin, Ramadan time in Africa/Casablanca, the move of Asia/Almaty in 2024) falls back to UTC as well, as OSAGI Backend Starter refuses it.
  • Plural forms come from Intl.PluralRules (lib/modules/text.ts).

Adding a language

  1. Translate the lib/i18n dictionary and the module texts; keep the keys.
  2. Switch the locale: REPORT_LOCALE, the date-fns locale imports and the lang that each root layout passes to RootDocument (app/(console)/layout.tsx, app/(auth)/layout.tsx, app/(marketing)/layout.tsx).
  3. Give every plural category of your language a form: PluralForms in lib/modules/text.ts has two forms (one, other) and needs as many as Intl.PluralRules returns for your locale.
  4. Check long words: German or French strings run up to a third longer. Screens wrap, but buttons and pills deserve a look at 390 px.
  5. Run pnpm test and walk through the screens in both themes.