ADR-0019 §9 sweep (1/2): replay/client_side/ok/mode/messages/project/parse
First half of the catalog migration sweep. Six categories of
user-visible literals moved from inline `format!` calls to the
i18n catalog via `t!()`:
- **replay.*** — `[ok] replay … N command(s) run`,
`replay … failed at line N: …`, the `> command` echo, and
the inner `could not open` / `parse error` / `nested replay`
wordings the runtime constructs inside `ReplayFailed.error`.
- **client_side.*** — the four [client-side] pedagogical notes
from ADR-0017 §6 / ADR-0018 §9 (transformed,
transformed_lossy, auto_fill_transition,
auto_fill_add_serial, auto_fill_add_shortid). The
`format_auto_fill_add_note` helper in db.rs now routes via
the catalog too.
- **ok.*** — the `[ok] {verb} {subject}` summary header
(consolidated through a new `App::note_ok_summary` helper)
plus the per-operation row-count footers
(`{count} row(s) inserted/updated/deleted`).
- **mode.*** — `mode: simple/advanced` set/show banners +
`usage: mode …` + `unknown mode '{value}' …` errors.
- **messages.*** — `messages: short/verbose` set/show + the
`unknown messages mode` error.
- **project.*** — `[ok] rebuild — {summary}`, `[ok] now
editing: {display_name}`, `[ok] export — wrote {path}`, plus
matching failure variants and the `usage: export/import`
+ `import: empty target after as` argument-parsing errors.
- **parse.*** — the `parse error: {detail}` wrapper around
chumsky's structural output, the `{padding}^` caret pointer,
and the `empty input` fallback for `ParseError::Empty`.
Catalog total: 99 lines of YAML across the new categories,
44 new entries declared in `keys.rs::KEYS_AND_PLACEHOLDERS`.
The validator (`keys_validate_against_catalog`) walks the
expanded list and confirms placeholder coverage / no format
specifiers / no engine vocabulary across every entry.
Anchor phrases (ADR-0019 §10) preserved verbatim; existing
substring assertions in the test suite hold.
## Tally
610 tests passing (no change in count — pure refactor).
Clippy clean with nursery lints. Release builds.
## Still ahead in the sweep
- Sweep 7: HELP_TEXT (CLI banner) + in-app `note_help` —
large multi-line blocks.
- Sweep 8: modal labels (load picker, rebuild confirm,
save-as path entry) + any remaining strays. Final pass.
Both shipping in a follow-up commit so this checkpoint
stays reviewable.
This commit is contained in:
@@ -1810,16 +1810,12 @@ fn generate_shortid_batch(
|
||||
/// on a non-empty table per ADR-0018 §9.
|
||||
fn format_auto_fill_add_note(ty: Type, row_count: usize) -> String {
|
||||
match ty {
|
||||
Type::Serial => format!(
|
||||
"[client-side] {row_count} row(s) given auto-generated serial \
|
||||
values 1..{row_count}. In raw SQL this would need an explicit \
|
||||
UPDATE to populate."
|
||||
),
|
||||
Type::ShortId => format!(
|
||||
"[client-side] {row_count} row(s) given auto-generated shortid \
|
||||
values. In raw SQL this would need an explicit UPDATE to \
|
||||
populate."
|
||||
),
|
||||
Type::Serial => {
|
||||
crate::t!("client_side.auto_fill_add_serial", count = row_count)
|
||||
}
|
||||
Type::ShortId => {
|
||||
crate::t!("client_side.auto_fill_add_shortid", count = row_count)
|
||||
}
|
||||
_ => unreachable!("called only for serial/shortid"),
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user