Skip to content

i18n: consume LOL via the liblol C ABI (Gnosis.I18n) — post-core #51

Description

@hyperpolymath

Implements ADR-0002 (#50): casket consumes standards/lol as a service via the liblol C ABI — never embedding the corpus.

Depends on: ADR-0001 (#42) typed a2ml/Djot content model — locale-keys hang off it, so this is post-core. Building the binding before the content model lands means retrofitting.

Done (in #50)

  • ADR-0002 decision record
  • ADJUST contractile i18n stanza (lol-linkage, no-embedded-locales, i18n-invariants)

To do

  • Gnosis.I18n module — foreign import ccall bindings against lol.h: lol_init, lol_translate, lol_translate_plural, lol_resolve_locale, lol_translation_text, lol_free_*, lol_last_error; wrapped in safe translate / translatePlural / resolveLang.
  • Render pipeline: lol_init(LOL_DATA_DIR) once per build; per localizable field lol_translate(handle, locale, key); counts via lol_translate_plural; <html lang/dir> via lol_resolve_locale; surface LOL_KEY_NOT_FOUND loudly (mirrors (:MISSING:key)).
  • Remove the four locales/*.txt stubs (the embedding the rule forbids).
  • Build packaging: liblol.so as a Guix/Nix input; corpus pinned via LOL_DATA_DIR.
  • Tests: golden localized output, fallback-chain behaviour, missing-key surfacing.

Interface

  • standards/lol/generated/abi/lol.h (C ABI), standards/lol/ABI-FFI-README.md (the Idris2-ABI / Zig-FFI / Zig-gateway triple).
  • Estate rule: claude-memory lol-i18n-linkage.mdcall LOL as a service, never embed.

Payoff

Inherits LOL's Idris2-proven i18n guarantees (BCP-47/key validity, store-lookup, fallback, plural bounds); correct per-locale lang/dir ⇒ WCAG 3.1.1/3.1.2; keeps casket lean (no corpus embedded). Same FFI-seam posture as the boj cartridge and the Djot core.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions