Deleting a company or an application: the 'This also deletes' counts are never extracted, so always English #388
Labels
No labels
accessibility
authentication
breaking change
bug
documentation
enhancement
interface
internationalisation
observability
performance
security
tier
1
tier
2
tier
3
tier/4
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo#388
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 at
95348908d, reading the delete views and searching every catalogue for their strings.Checked again on 2026-10-01 against
mainat0a5cad587: still present.The company and application delete pages pass their plural texts to
ngettextthrough variables. The extractor reads call sites and takes only literal arguments, so those texts are in no catalogue, and every language shows them in English on the page whose job (#217) is to say exactly what will be lost.jobs/views.py:593-601(CompanyDeleteView.get_context_data) andapplications/views.py:491-503(ApplicationDeleteView.get_context_data), both of the formcounts = ((n, "%(count)d posting", "%(count)d postings"), ...)and thenngettext(one, many, number) % {"count": number}; drawn bytemplates/partials/confirm_delete.html:20-26. The extractor iscore/messages_tool.py(CALLSat line 111 onwards), which takes a message only from a literal argument at the call."%(count)d posting","%(count)d application","%(count)d contact","%(count)d entry on its timeline","%(count)d interview"or"%(count)d reminder"appears as a msgid in anylocale/*/LC_MESSAGES/django.po. A German user deleting a company reads "Dies löscht außerdem:" followed by "3 postings", "5 applications", "2 contacts"; deleting an application lists "12 entries on its timeline", "2 interviews", "1 reminder".PostingDeleteView(jobs/views.py:909-942) writes its literals inside the call, and its "entry in its history" strings are in the catalogues.test_the_catalogues_are_what_a_fresh_extraction_writescannot notice, because a fresh extraction does not see these strings either.ngettextcall with its two literals inline, asPostingDeleteViewdoes, and runscripts/messages.py extract. To stop it recurring, have the extractor (or a test) report any gettext-family call insrc/whose message argument is not a string literal; today these two are the onlyngettextcalls with variable arguments.Done when
tests/test_translations.pyhas a test that walkssrc/postulowithastand fails on any call named inmessages_tool.CALLSwhose message or plural argument is not a string constant.compiledfixture intests/test_translations.py) and asserts the English "postings" is absent.