diff options
| author | Danilo M. <danix@danix.xyz> | 2026-08-15 12:37:41 +0200 |
|---|---|---|
| committer | Danilo M. <danix@danix.xyz> | 2026-08-15 12:37:41 +0200 |
| commit | 5a3f827a01d1902a0dadc5debb4200138d4af885 (patch) | |
| tree | 5b00207aefccf625a54ac4b928a05561d1a0fff1 /CHANGELOG.md | |
| parent | 8e7208dc771bc9344f583442ad58cdd5b4178233 (diff) | |
| download | qtmaildir-5a3f827a01d1902a0dadc5debb4200138d4af885.tar.gz qtmaildir-5a3f827a01d1902a0dadc5debb4200138d4af885.zip | |
feat(i18n): wire translations and ship an Italian one (item 22)
Nothing loaded a translation before this: no QTranslator, no .ts file and
no build rule, so every string was English whatever the locale said. The
language now comes from the environment, LANG=it_IT.UTF-8, and any other
locale runs in English as before.
The audit found that the tr() discipline was largely holding, and found
eight strings that could never be translated into any language. kFields[]
in tagrulesdialog.cpp declared the rule-builder field labels with
QT_TR_NOOP inside an anonymous namespace, where lupdate reports "tr()
cannot be called without context" and extracts nothing, while the use site
calls TagRulesDialog::tr() on them at runtime. From, To, Cc, Subject, Tag,
Folder, Attachment and Date: the whole vocabulary of the rule builder,
absent from every translation file that could ever exist. The source
compiles and reads correctly; only lupdate reveals it.
Q_DECLARE_TR_FUNCTIONS is not the fix for that case, though it is the fix
for a free function calling tr(). Measured against lupdate: a class
carrying the macro beside the array still extracts 0 strings, because the
context must be attached to the literal itself. QT_TRANSLATE_NOOP names it
explicitly and matches the tr() that already reads them, so the use site
needed no change.
Twenty configuration and keybinding warnings were not translatable either.
They are user-facing, reaching the status label and the "Configuration
problems" dialog. Config already had the tr() macro; KeyMap needed it.
Translating the filter labels then broke startup_query, found in hand
testing: a filter's name is a translated label, so `startup_query = Inbox`
matched nothing where the filter shows as "In arrivo". The application
opened a different view and reported the user's own working config as
invalid. Resolution matches the generator as well now, which is stored in
queries.json and identical in every locale; the translated name still
works. The regression test installs a real QTranslator rather than a stub,
since the bug lives in the gap between the stored string and the displayed
one, and it writes a queries.json because the warning it asserts on is
guarded by a non-empty saved-query list: without one the branch never runs
and the test passes against a broken check.
main.cpp's --help and --version stay bare printf, as they run before
QApplication exists and no translator could serve them.
Verified per the backlog's own standard, that lupdate output is the
evidence rather than reading: 355 strings extracted with zero context
warnings, where before there were 327 with eight; lrelease reporting 355
finished and 0 unfinished; the built .qm loaded in a standalone probe
printing "From -> Da" and both Italian plural forms; and the install rule
placing it where main.cpp looks. test_translations guards it and was
mutation checked, failing on an emptied translation and naming the defect
when QT_TRANSLATE_NOOP is reverted.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'CHANGELOG.md')
| -rw-r--r-- | CHANGELOG.md | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index c176c6a..07f4a47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,36 @@ point at which they are stable. ## [Unreleased] +### Added + +- **An Italian translation, and the machinery to load one.** Nothing read a + translation before this: there was no `QTranslator`, no `.ts` file and no + build rule, so every string was English whatever the locale said. The + language comes from the environment, `LANG=it_IT.UTF-8`, and any other + locale runs in English as before. All 355 strings are translated. +- `ctest -R translations` guards the translation against the two ways it rots: + a new string added without one, and a string `lupdate` cannot see at all. + +### Fixed + +- **Eight labels in the tagging-rules dialog could never be translated**, in + any language. From, To, Cc, Subject, Tag, Folder, Attachment and Date were + declared with `QT_TR_NOOP` inside an anonymous namespace, where `lupdate` + extracts nothing while the dialog's own `tr()` reads them at runtime, so no + translation file ever contained them. The source looked correct and only + `lupdate` revealed it. +- Twenty configuration and keybinding warnings were not translatable. They are + user-facing: they appear in the status bar and the "Configuration problems" + dialog. +- **`startup_query` naming a built-in filter stopped working under a translated + interface**, found in hand testing the Italian build. A filter's name is a + translated label, so `startup_query = Inbox` matched nothing where the filter + is shown as "In arrivo": the application opened a different view and reported + the user's own working configuration as invalid. It now resolves on the + generator as well, which is the same in every language, so a config written + in English keeps working whatever `LANG` says. The translated name is still + accepted. + ## [0.22.0] - 2026-08-15 Follows 0.21.0's built-in filters with the parts that shipped wrong or missing. |
