• v2.2.0 cbe0eec9f8

    v2.2.0 Stable

    michael released this 2026-10-17 11:35:31 +02:00 | 0 commits to main since this release

    Breaking changes

    • Contribution labels are daw_i18n/v1 resource references. label
      (a { de = ..., en = ... } table) is now label_resource_id (a
      resource id string) on groups, commands and subcommands -- in the
      contribution.json input and in the output of composer.compose()
      and scanner.build_index(). Hard cutover, no transition period.
      berhtjan-core passes the id through unresolved. See
      DAW/daw-modul-berhtjan-core#12.
    • lang.resolve_label() is removed, together with its error code
      label_not_found. resolve_resource(resource_id, catalogs, languages)
      replaces it and returns result, nil | nil, daw_error/v1, the result
      being { text, requested_language, resolved_language, fallback_occurred }. catalogs holds one catalog per language,
      catalogs[language][resource_id]. Every language of languages must
      have a catalog (catalog_not_loaded otherwise -- nothing is skipped
      silently); an unknown id and a missing translation are both
      no_translation_available.
    • lang.resolve_lang() validates its context. A non-table ctx is
      invalid_ctx, a non-string user_locale or lang is
      invalid_ctx_field, and ctx.lang must be a language code of
      lowercase letters (invalid_language_code) -- any string was
      accepted before.
    • scanner.build_index() rejects a command defined by two
      contributions
      with command_name_collision (nil, err). It used to
      keep the later one and drop the earlier one silently. See
      DAW/daw-modul-berhtjan-core#16.
    • berhtjan-cli 2.1.0 does not work with this release. It calls
      core.resolve_label() at several places. A matching berhtjan-cli
      release follows.

    New

    • lang.language_chain(ctx) -- the ordered language chain for
      resolve_resource(): the resolved user language, then
      ctx.default_lang unless it is the same language. Exported by the
      facade.
    • Build-time logic for the per-language resource catalogs
      (resources.lua, facade exports parse_resource_source() and
      generate_catalogs()): validate daw_i18n/v1 sources, merge them by
      priority per (resource id, language), require the default language to
      be complete, and write a catalog as a Lua data file. Pure functions;
      the host reads the sources and installs the result. See
      DAW/daw-modul-berhtjan-core#13.
    • scanner.build_index(): command entries carry module, the
      contribution's module identity.
    • i18n/en.json and i18n/de.json -- 79 daw_i18n/v1 resources; every
      error site now carries a resource_id.

    Fixes

    • lang.resolve_lang(): a malformed context (for example
      user_locale = 123) raised a raw Lua error; it now returns
      daw_error/v1.
    • lang.lua: the bootstrap fallback was a plain string; it is the
      reserved daw-error-facility-unavailable sentinel now, in all
      modules.

    Internal

    • loader.lua: the shared _check_deps() plain-string helper is gone;
      the five parse_contribution() error sites carry a resource_id.
    • Test suite: 207 -> 541 tests, Lua 5.1 and 5.4.

    Migrating

    1. In every contribution.json, replace "label": { ... } with
      "label_resource_id": "<uuid>" and ship the text as a
      daw_i18n/v1 resource (canonical English in i18n/en.json).
    2. Replace resolve_label(label, lang, default_lang) with
      language_chain(ctx) and resolve_resource(id, catalogs, chain).
    3. Pass only language codes of lowercase letters (or nothing) as
      ctx.lang and ctx.default_lang.

    Requires daw-lua-common >= 2.1.0.

    Downloads