daw_i18n/v1: define the placeholder name form and literal braces #18

Open
opened 2026-11-15 21:25:04 +01:00 by michael · 1 comment
Owner

Problem

daw_i18n/v1, section 5, defines placeholders as {name} but leaves two
things open that every implementation has to decide:

  1. which characters a placeholder name may contain
  2. how to write a literal { or } in a text

Anyone can write texts in an open-source project (translators, module
authors). Without a rule, a typo like { name } or {Name} is either
output as plain text or rejected, depending on the implementation.
Existing catalogs already contain plain braces, for example
"sources must be a list of { name, priority, catalogs }".

Proposal (to discuss)

  • fix the name form (all existing catalogs use letters, digits and _)
  • decide: is a brace that is not a valid placeholder plain text, an
    error, or does it need an escape form?
  • if an escape form is needed: say which, and what it means for
    source_hash (the hash covers the text as written)

Why now

DAW/daw-modul-berhtjan-core adds format_text(text, params)
(see the core issue); until this is decided the core marks its rule as
provisional.

Acceptance criteria

  • decision documented in specification.md and rationale.md
  • changelog entry; check whether the change is a v1 clarification
  • test vectors for the cases decided

DAW/daw-modul-berhtjan-core (format_text issue)

## Problem `daw_i18n/v1`, section 5, defines placeholders as `{name}` but leaves two things open that every implementation has to decide: 1. which characters a placeholder name may contain 2. how to write a literal `{` or `}` in a text Anyone can write texts in an open-source project (translators, module authors). Without a rule, a typo like `{ name }` or `{Name}` is either output as plain text or rejected, depending on the implementation. Existing catalogs already contain plain braces, for example "sources must be a list of { name, priority, catalogs }". ## Proposal (to discuss) - fix the name form (all existing catalogs use letters, digits and `_`) - decide: is a brace that is not a valid placeholder plain text, an error, or does it need an escape form? - if an escape form is needed: say which, and what it means for `source_hash` (the hash covers the text as written) ## Why now DAW/daw-modul-berhtjan-core adds `format_text(text, params)` (see the core issue); until this is decided the core marks its rule as provisional. ## Acceptance criteria - [ ] decision documented in specification.md and rationale.md - [ ] changelog entry; check whether the change is a v1 clarification - [ ] test vectors for the cases decided ## Related DAW/daw-modul-berhtjan-core (format_text issue)
Author
Owner

Status: no escape form

Decided with the format_text work (contract state 767fb16,
DAW/daw-modul-berhtjan-core): there is no escape form for a literal
{ or }. Substitution is a single pass, and values are a string or an
integer (section 5 of daw_i18n/v1 already says so for the values).

What this means for the proposal above:

  • the third point ("if an escape form is needed ...") is dropped, and
    with it the question what an escape means for source_hash: the hash
    keeps covering the text as written
  • still open and to be written into section 5 of specification.md:
    1. the form of a placeholder name (all existing catalogs use letters,
      digits and _)
    2. whether a brace that is not a valid placeholder is plain text or an
      error
  • test vectors for both cases

Section 5 does not yet say anything about name form or literal braces;
until it does, the core keeps its rule marked as provisional.

## Status: no escape form Decided with the `format_text` work (contract state 767fb16, DAW/daw-modul-berhtjan-core): there is **no escape form** for a literal `{` or `}`. Substitution is a single pass, and values are a string or an integer (section 5 of `daw_i18n/v1` already says so for the values). What this means for the proposal above: - the third point ("if an escape form is needed ...") is dropped, and with it the question what an escape means for `source_hash`: the hash keeps covering the text as written - still open and to be written into section 5 of `specification.md`: 1. the form of a placeholder name (all existing catalogs use letters, digits and `_`) 2. whether a brace that is not a valid placeholder is plain text or an error - test vectors for both cases Section 5 does not yet say anything about name form or literal braces; until it does, the core keeps its rule marked as provisional.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
DAW/daw-contracts#18
No description provided.