Pass locale and language settings: bin/fragjan reads the locale, config holds lang and default_lang #148
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/architecture
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
research
type
security
type/task
type/tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
DAW/fragjan#148
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
Give berhtjan-core the language information it needs to resolve texts:
the locale is read in bin/fragjan and passed as a runtime parameter,
the language settings come from the program config, adapters/ui only
assembles them. Berhtjan checks the fields; it never reads the
environment.
Background
Found while tracing where the language comes from for
DAW/daw-modul-berhtjan-core#13. Nothing in fragjan, berhtjan-cli or
berhtjan-core sets user_locale, lang or default_lang (no getenv/LANG
anywhere). berhtjan-cli reads ctx.default_lang and calls
core.resolve_lang(ctx), which therefore returns no_language_resolvable
as soon as a label has to be resolved.
bin/fragjan already determines the facts of the environment (OS, HOME,
Lua binary) and passes them to main.lua as --runtime-* parameters; the
locale belongs there.
Scope
unset: LOCALE="${LC_ALL:-${LC_MESSAGES:-${LANG:-}}}"; pass it as
--runtime-locale
existing parameters are required (an empty value stops with 9998);
an empty or unset locale is normal (cron, containers) and must not
is absent or not resolvable) and default_lang (the guaranteed
fallback, must be an installed language)
pass lang / default_lang from the config unchanged; berhtjan-core
validates them (language code of lowercase letters)
silently
Acceptance criteria
are honoured in that order
outside bin/
Related
DAW/daw-modul-berhtjan-core#13, DAW/fragjan#141
Handing only the needed fields to each part (instead of the whole ctx)
is a separate topic.
Update 2026-10-17
Partly superseded by DAW/fragjan#149 (accepted decision: ctx is built in
the host, not in adapters/ui, and each module gets only the fields it
requests).
Changes to the scope of this issue:
applies. The host builds the language fields (user_locale, lang,
default_lang) and hands them only to modules that request them.
Unchanged:
--runtime-locale
Also relevant: the resource catalog build (DAW/daw-modul-berhtjan-core#13)
reads [language] default_lang from the program config.
Implemented on develop
Checked against the code on develop (
a626250):LANG; an empty value counts as unset) and passes --runtime-locale.
an empty or missing value is accepted. The four other runtime
parameters stay required.
templates/config/fragjan.conf; a missing or invalid section is reported
(language_section_invalid), not defaulted.
unset, LC_ALL before LC_MESSAGES before LANG) and
test/test_ui_context.lua (language chain).
Still in adapters/ui build_ctx for now: the mapping of runtime.locale to
the language fields. It moves to the host together with
DAW/fragjan#149, as noted in the update of 2026-10-17.