Design daw_i18n/v1 text override for host programs #13
Labels
No labels
coordination/cross-repo
coordination/needed
effort
large
effort
medium
effort
small
meta/duplicate
meta/planning
meta/wontfix
priority
high
priority
low
priority
medium
session
blocker
session
handover
session
next
status
blocked
status
done
status
in-progress
status
review
status
to-go
type
admin
type
bug
type
config
type
deployment
type
docs
type/documentation
type
enhancement
type
feature
type
handover
type
infrastructure
type
installation
type
maintenance
type
migration
type/refactor
type
research
type
security
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/daw-modul-berhtjan-core#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Goal
Design how a host program can override a daw_i18n/v1 text
(from a library or module) with its own text for a given resource_id.
Background
Raised while deciding DAW/daw-lua-common#47 (i18n resource file
location). Text override is a special case of the still-open
daw_i18n/v1 discovery/collection question (deliberately kept out of
the daw_i18n/v1 contract itself) and belongs into the same
architecture work as language selection/loading in berhtjan-core.
Scope
library/module's own i18n/ resources
Related
DAW/daw-lua-common#47
Open question: whether the override mechanism belongs into berhtjan-core itself or into the adapter layer (core vs. adapter placement, analogous to the fs.handle -> fs facade pattern in daw-error-standard.md). Not decided yet -- part of the design scope of this issue.
Decision summary, delivered in v2.2.0
The placement question of this issue (core or adapter) is answered:
berhtjan-core only resolves texts; it neither finds nor overrides them.
Resolution (berhtjan-core)
resolve_resource(resource_id, catalogs, languages)looks a text up inone catalog per language and returns
{ text, requested_language, resolved_language, fallback_occurred }. A language of the chainwithout a catalog is an error (
catalog_not_loaded), never skipped.language_chain(ctx)builds the chain: user language, thenctx.default_langunless identical. No implicit English.Overrides and discovery (host, install time)
daw_i18n/v1sources. The host merges allsources by configured priority, per (resource_id, language), into one
generated Lua data file per language, plus a pointer file naming the
active generation. A host override is simply a source with a higher
priority; a partial override (one language) leaves the other languages
of the resource untouched.
aborts and the active generation stays as it is.
(
parse_resource_source,generate_catalogs); reading the files andactivating the result is the host's job. No registry, no scope field.
source_hashstaleness is acheck on the source files, not at runtime.
Not resources
messages) stay inline per language in the definition.
Open (not decided here)
source_hashof an override source refers to.Delivered by
1772d38,bfff6d0andf67c14e, released as v2.2.0 togetherwith daw-lua-common 2.2.0 and daw-lua-net 2.2.0. Loading in the hosts and
the berhtjan-cli migration are tracked in their own repositories.