Skip to content

Add localization infrastructure via locale.library catalogs (#67 Phase 1) - #105

Merged
sidick merged 2 commits into
mainfrom
localization-catalogs-67
Jul 28, 2026
Merged

sidick merged 2 commits into
mainfrom
localization-catalogs-67

Conversation

@sidick

@sidick sidick commented Jul 28, 2026

Copy link
Copy Markdown
Owner

Summary

  • Centralizes user-visible strings behind AmigaOS's standard locale.library catalog system (OS 2.1+/V38), so community translations drop into LOCALE:Catalogs/<language>/AmiAuth.catalog without a rebuild. Absence of locale.library, or of a matching catalog, is never an error — English built-ins are always the fallback.
  • locale/AmiAuth.cd is the single source of truth (standard catcomp/FlexCat .cd format); make catalog-strings regenerates the checked-in src/core/catalog_strings.h via a vendored FlexCat build (tools/fetch-flexcat.sh) — a host-only build tool, never a runtime or shipped dependency.
  • src/core/catalog.h/.c (portable + host stub) and src/amiga/catalog.c (real backend) provide one MSG(id) macro usable identically at every call site, host or Amiga.
  • A representative slice of 17 strings (CLI errors/status, GUI requesters, account list column headers) is migrated to prove the pattern end-to-end. The full ~150-180-string migration and locale-aware date/number formatting (the rest of Locale: fall back through loc_PreferredLanguages when the primary language has no catalog #67) are follow-up work.
  • New userdocs/Localization.md for both users (installing a translation) and translators (contributing one).

Test plan

  • make test — 393/393 host unit tests pass (new test_catalog.c covers the host stub contract)
  • make m68k-docker / make gui-docker — both build clean, zero warnings
  • make catalog-nolib-onhw-docker — builds a test-only CLI variant with a deliberately-nonexistent locale.library name
  • make catalog-onhw-smoke — new on-target test: boots WB 3.2 under Copperline, runs both the real CLI binary and the nonexistent-library variant in the same boot, asserts both produce identical correct English output (proves both the "catalog present, skipped" and "library entirely absent" fallback paths on real 68k hardware)
  • make gui-smoke / make arexx-onhw-smoke — no regression in prior on-target work
  • make guide — AmigaGuide docs build (new Localization.md page included)

Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com

https://claude.ai/code/session_01K5bAsAyoYLpkX3rWwrTBPh

sidick and others added 2 commits July 28, 2026 12:31
…e 1)

Centralizes user-visible strings behind AmigaOS's standard locale.library
catalog system (OS 2.1+) so community translations drop into
LOCALE:Catalogs/<language>/AmiAuth.catalog without a rebuild, with English
built-ins as the always-available fallback - the same optional-feature
pattern used throughout this codebase (absence of locale.library, or of a
matching catalog, is never an error).

- locale/AmiAuth.cd is the single source of truth for translatable strings
  (standard catcomp/FlexCat format); `make catalog-strings` regenerates the
  checked-in src/core/catalog_strings.h via a vendored FlexCat build
  (tools/fetch-flexcat.sh), never a runtime or shipped dependency.
- src/core/catalog.h/.c (portable + host stub) and src/amiga/catalog.c
  (real OpenLibrary/OpenCatalog/GetCatalogStr backend) provide one MSG(id)
  macro usable identically at every call site, host or Amiga.
- A representative slice of 17 strings (CLI errors/status, GUI requesters,
  account list column headers) is migrated as a proof of the pattern; the
  full ~150-180-string migration and locale-aware date/number formatting
  are follow-up work.
- Tests: host stub-contract test, plus a real on-target Copperline test
  booting two CLI binaries (real and a deliberately-nonexistent
  locale.library name) to prove both the "catalog present" and "library
  entirely absent" fallback paths on real 68k hardware.
- New userdocs/Localization.md for users and translators.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5bAsAyoYLpkX3rWwrTBPh
…entry

MSG_CLI_ERR/MSG_CLI_ALREADY_EXISTS had the literal brand name baked into
the translatable text ("AmiAuth: %s\n") - translators would have had to
copy it verbatim into every language for no reason. Pass it as a %s
argument instead, matching MSG_CLI_USAGE_RUNAS's existing convention.

That left MSG_CLI_ERR as literally "%s: %s\n" - its payload is
vault_err()'s own text, not yet migrated (Phase 2), so there was nothing
left to translate. Dropped it from the Phase 1 slice entirely and reverted
its call sites to the original hardcoded literal; id 0 stays unused/
reserved for when vault_err()'s strings are migrated for real.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K5bAsAyoYLpkX3rWwrTBPh
@sidick
sidick merged commit 2a1cc43 into main Jul 28, 2026
7 checks passed
@sidick
sidick deleted the localization-catalogs-67 branch July 28, 2026 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant