fix(adapters/ui): show translation problems instead of hiding them #153

Closed
opened 2026-11-17 20:13:52 +01:00 by michael · 2 comments
Owner

Problem

adapters/ui/messages.lua of() hid every translation problem: when the
catalog was not loaded or the resource_id was unknown, it silently showed
the canonical English text. A fallback to a later language of the chain was
not visible either. The user could not tell a translated text from a missing
one.

Solution

  • of() and text() return text, problem. The text is always there (a
    display has to be total); the problem is the daw_error/v1 of
    resolve_resource.
  • A text taken from a later language of the chain is marked: ... [en].
  • A problem is shown as a line of its own: [WARN] No translation: ...
    (event sink, describe, results; results end with exit.warn).
  • ask: a question whose text is missing is not asked; the problem is
    returned. question_unanswered carries question_problem.
  • New message translation_problem (en, de).
  • Without catalogs or without resource_id there is nothing to translate
    with, and no problem.

Acceptance criteria

  • tests first (test_ui_messages, test_ui_results, test_ui_dispatch)
  • make test passes with Lua 5.1 and 5.4
  • fragjan code . passes

DAW/fragjan#148 (language chain), DAW/daw-contracts#20 (event message),
DAW/daw-modul-berhtjan-cli (resolve_resource)

## Problem `adapters/ui/messages.lua` `of()` hid every translation problem: when the catalog was not loaded or the `resource_id` was unknown, it silently showed the canonical English text. A fallback to a later language of the chain was not visible either. The user could not tell a translated text from a missing one. ## Solution - `of()` and `text()` return `text, problem`. The text is always there (a display has to be total); the problem is the `daw_error/v1` of `resolve_resource`. - A text taken from a later language of the chain is marked: `... [en]`. - A problem is shown as a line of its own: `[WARN] No translation: ...` (event sink, `describe`, results; results end with `exit.warn`). - `ask`: a question whose text is missing is not asked; the problem is returned. `question_unanswered` carries `question_problem`. - New message `translation_problem` (en, de). - Without catalogs or without `resource_id` there is nothing to translate with, and no problem. ## Acceptance criteria - [x] tests first (`test_ui_messages`, `test_ui_results`, `test_ui_dispatch`) - [x] `make test` passes with Lua 5.1 and 5.4 - [ ] `fragjan code .` passes ## Related DAW/fragjan#148 (language chain), DAW/daw-contracts#20 (event message), DAW/daw-modul-berhtjan-cli (`resolve_resource`)
Author
Owner

Implemented on develop

Commits: 60635b2

Pushed. Follow-up points, if any, are tracked in their own issues.

## Implemented on develop Commits: 60635b2 Pushed. Follow-up points, if any, are tracked in their own issues.
michael 2026-11-18 11:58:47 +01:00
Author
Owner

The last open criterion ('fragjan code . passes') is not met: running it on fragjan itself reports 193 plain string error returns. These do not come from this change; fragjan has not been migrated to daw_error/v1 itself. Tracked in DAW/fragjan#157, which takes over this criterion. The translation problem display of this issue is implemented and stays closed.

The last open criterion ('fragjan code . passes') is not met: running it on fragjan itself reports 193 plain string error returns. These do not come from this change; fragjan has not been migrated to daw_error/v1 itself. Tracked in DAW/fragjan#157, which takes over this criterion. The translation problem display of this issue is implemented and stays closed.
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/fragjan#153
No description provided.