-
v2.2.0 Stable
released this
2026-10-17 11:35:31 +02:00 | 0 commits to main since this releaseBreaking changes
- Contribution labels are
daw_i18n/v1resource references.label
(a{ de = ..., en = ... }table) is nowlabel_resource_id(a
resource id string) on groups, commands and subcommands -- in the
contribution.jsoninput and in the output ofcomposer.compose()
andscanner.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 returnsresult, nil | nil, daw_error/v1, the result
being{ text, requested_language, resolved_language, fallback_occurred }.catalogsholds one catalog per language,
catalogs[language][resource_id]. Every language oflanguagesmust
have a catalog (catalog_not_loadedotherwise -- nothing is skipped
silently); an unknown id and a missing translation are both
no_translation_available.lang.resolve_lang()validates its context. A non-tablectxis
invalid_ctx, a non-stringuser_localeorlangis
invalid_ctx_field, andctx.langmust 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 withcommand_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_langunless it is the same language. Exported by the
facade.- Build-time logic for the per-language resource catalogs
(resources.lua, facade exportsparse_resource_source()and
generate_catalogs()): validatedaw_i18n/v1sources, 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 carrymodule, the
contribution's module identity.i18n/en.jsonandi18n/de.json-- 79daw_i18n/v1resources; every
error site now carries aresource_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
reserveddaw-error-facility-unavailablesentinel now, in all
modules.
Internal
loader.lua: the shared_check_deps()plain-string helper is gone;
the fiveparse_contribution()error sites carry aresource_id.- Test suite: 207 -> 541 tests, Lua 5.1 and 5.4.
Migrating
- In every
contribution.json, replace"label": { ... }with
"label_resource_id": "<uuid>"and ship the text as a
daw_i18n/v1resource (canonical English ini18n/en.json). - Replace
resolve_label(label, lang, default_lang)with
language_chain(ctx)andresolve_resource(id, catalogs, chain). - Pass only language codes of lowercase letters (or nothing) as
ctx.langandctx.default_lang.
Requires daw-lua-common >= 2.1.0.
Downloads
-
Source code (ZIP)
0 downloads
-
Source code (TAR.GZ)
0 downloads
- Contribution labels are