Test button: the result says 'holds 1 documents', because the count has no plural form #10
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-paperless#10
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-paperless at
973969bb7, reading every translated string in the store against its catalogues.The sentence the Test button returns is one fixed string for every count. It is wrong in English for one document, and no language with plural forms can translate it correctly, because the catalogue has a single entry.
Where:
src/postulo_paperless/store.py:306-309, intest():What happens: a person connects a Paperless-ngx archive that holds one document and reads "Reachable. The archive holds 1 documents." In Polish the catalogue's one translation, "Osiągalny. Archiwum zawiera %(count)d dokumentów." (
src/postulo_paperless/locale/pl/LC_MESSAGES/django.po:79-80), is the form for five or more and is shown for one and for two to four as well; the same holds for every language whose header declares more than two forms. There is nongettextanywhere in the package.Why it matters: every user-facing string is meant to be translatable, and this one cannot be. The core's catalogue tool already extracts
ngettext(core/messages_tool.py:116) andpostulo-messages checkverifies that plural forms agree.Fix:
ngettext("Reachable. The archive holds %(count)d document.", "Reachable. The archive holds %(count)d documents.", count) % {"count": count}, imported fromdjango.utils.translation; thenuv run postulo-messages extract, refill the entry in the working languages, anduv run postulo-messages compile.Done when
tests/test_paperless.py, beside the one at line 260 that expects "Reachable. The archive holds 0 documents.", has the fake archive report one document and expects "Reachable. The archive holds 1 document."; it fails today.msgid_plural, andtests/test_catalogues.py::test_placeholders_and_plural_forms_agreepasses.