i18n: single-pass placeholder substitution, and a test for the translator's disambiguation path #33

Closed
opened 2026-10-22 08:52:20 +00:00 by claude-bot · 0 comments
Collaborator

Two follow-ups from #25's reviews (218 and the audit), for #14 part 2:

  1. core/src/worker/session.rs (open_reader notice) fills %1 and %2 with chained .replace(). A value containing %2 would be substituted again. SWORD module names are alphanumeric today, so it can't happen yet. Add a single-pass tr substitution helper (e.g. tr_args("…", &[a, b])) and use it everywhere. This matters once part 2 brings in values a user can type.
  2. qt/main.cpp CatalogueTranslator::translate returns a null QString (so Qt shows the source) for a non-empty disambiguation or a null sourceText. Nothing exercises that branch. When part 2 adds context support, add a check (check-app or a C++ test) that a qsTr("…", "comment") string shows its source, or its translation once contexts are supported, and never shows a blank.
Two follow-ups from #25's reviews (218 and the audit), for #14 part 2: 1. `core/src/worker/session.rs` (open_reader notice) fills `%1` and `%2` with chained `.replace()`. A value containing `%2` would be substituted again. SWORD module names are alphanumeric today, so it can't happen yet. Add a single-pass `tr` substitution helper (e.g. `tr_args("…", &[a, b])`) and use it everywhere. This matters once part 2 brings in values a user can type. 2. `qt/main.cpp` `CatalogueTranslator::translate` returns a null QString (so Qt shows the source) for a non-empty disambiguation or a null sourceText. Nothing exercises that branch. When part 2 adds context support, add a check (check-app or a C++ test) that a `qsTr("…", "comment")` string shows its source, or its translation once contexts are supported, and never shows a blank.
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
schaefera/utStudyBIble#33
No description provided.