Suggestions: “Matched by” and “Recognised” carry English literals, and the labels are in the scheduler's language #9
Labels
No labels
bug
documentation
enhancement
performance
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-imap#9
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found on 2026-09-29 in a read-only review of postulo-imap at
cc09c6381, following a suggestion's context fromsync()to the Suggestions page and running a pass for an owner whose language is Portuguese.Related to postulo/postulo#335.
Under each suggestion Postulo prints the context the plugin stored, as
key: value. The plugin translates the three keys when the pass runs and stores the result, and the values of two of them are never translatable at all: how the message was matched is one of five English literals, and what was recognised is the rule file's key. A person reading in any other language sees English words on every suggestion, and after a scheduled pass the labels are English too.src/postulo_imap/sync.py:199-205: the context dictionary.str(_("Matched by")): found.how if found else str(_("nothing yet"))andstr(_("Recognised")): f"{verdict.kind} ({verdict.language}): {verdict.matched}".src/postulo_imap/matching.py:98,:112,:124,:135,:143:Match.howis"thread","contact","domain","company name"or"role", none of them through gettext.src/postulo_imap/classifying.py:40-46:verdict.kindis a key ofOUTCOMES(acknowledged,rejected,interview,assessment,offer), an identifier used as a word.src/postulo_imap/sync.py:194:str(_("A message with no subject"))is stored as the suggestion's summary in the same way.templates/applications/suggestion_list.html:61-62prints{{ key }}: {{ value }}as stored;plugins/syncing.py:80callsplugin.sync(...)with no language activated, and the scheduler is a management command, where the active language isLANGUAGE_CODE(en-gb).tests/test_imap.py:555pins the literal:assert "domain" in " ".join(acknowledged.context.values()).pt-pt.get_language()isen-gb) stored{'From': …, 'Matched by': 'domain', 'Recognised': 'rejected (pt): lamentamos informar'}and, for an unmatched message,'Matched by': 'nothing yet'. The person reads those English lines under every suggestion, on a page that is otherwise Portuguese.pt-pt, which is what Sync now gives, stored{'De': …, 'Associado por': 'domain', 'Reconhecido': 'rejected (pt): lamentamos informar'}: translated labels, English values.gettext_lazystring, inmatching.pyandclassifying.py), and storestr()of those. KeepMatch.howandVerdict.kindas identifiers for the code and the tests.sync_connectionshould run each sync insidetranslation.override(<the owner's language>), asnotify()does since postulo/postulo#223 (closed), which fixed the recipient's language for notifications only. That half is reported separately in this review against postulo, together withSyncReport.summary();language_foris not onpostulo.plugins.api, so the plugin cannot do it itself without reaching past the surface. Until the core does it, the labels of a scheduled pass stay inLANGUAGE_CODE.postulo-messages extract.Done when
tests/test_imap.pyhas a test that runs a pass insidetranslation.override("pt-pt")over one message matched by its domain and one left unmatched, and asserts that no value in either suggestion's context containsdomain,rejectedoracknowledged, and thatMatch.howis still"domain". It fails today on the values.tests/test_imap.py:555asserts the identifier on theMatch, or the translated label, not an English word inside the stored context.Fixed by pull request #25.