Add format_text(text, params) to fill placeholders of a resolved text #22
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#22
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?
Problem
resolve_resource()returns the raw catalog text with its{name}placeholders. Every consumer fills them itself (fragjan has its own
fill, which leaves a missing value as{name}in the output). Theadapters (cli, web, api) all need the same step, so it belongs in core.
Waiting for it: DAW/daw-modul-berhtjan-cli#13 and the question text of
the first decision_required event (DAW/daw-modul-berhtjan-cli#15).
Scope
format_text(text, params)-> text | nil,daw_error/v1{name}is replaced byparams[name]; a string is inserted as given,an integer in base-10 notation without grouping (
daw_i18n/v1, section 5){name})paramsthat the text does not use are alloweddaw_error/v1, oneresource_idper error siteProvisional (marked as such until the contract decides)
daw_i18n/v1does not define the form of a placeholder name nor how towrite a literal brace. Until then:
{name}with letters, digits and_in the name(the form all existing catalogs use)
{or}is plain text and is output unchanged{name}that is not a placeholder cannot be writtenSee the companion issue in DAW/daw-contracts. Known texts with plain
braces today: "sources must be a list of { name, priority, catalogs }"
(DAW/daw-modul-berhtjan-core) and "... [...] oder {...} ..." (DAW/daw-lua-common).
Not in this issue
placeholders as the canonical text (
daw_i18n/v1, section 5); afollow-up once the contract is clear
Acceptance criteria
value, plain braces, repeated placeholder
daw_i18n/v1resourcesfragjan code .andmake test(Lua 5.1 and 5.4) passRelated
DAW/daw-contracts (
daw_i18n/v1), DAW/daw-modul-berhtjan-cli#13,DAW/daw-modul-berhtjan-cli#15