Test button: 'Delivered to N services' chooses singular or plural in code, so languages with more than two forms cannot be translated #14
Labels
No labels
bug
documentation
enhancement
security
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Postulo/postulo-apprise#14
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-apprise at
7637d899d, reading every translated string in the notifier against its catalogues.The result of the Test button picks between two separate sentences with
count == 1. That is the English rule written into the code. A language with three or more plural forms gets two unrelated entries to translate and no way to supply the others.Where:
src/postulo_apprise/notifier.py:216-224, intest():What happens: the plugin ships 68 catalogues, and their headers declare the right rules:
nplurals=4for Slovenian,nplurals=5for Irish,nplurals=6for Arabic. The two msgids appear in each as separate singular entries (for examplesrc/postulo_apprise/locale/sl/LC_MESSAGES/django.po:46and:51), so a person reading Postulo in one of those languages who tests a connection with two, three or five lines is shown the one sentence written for "not one", whatever the count. A translator in Weblate sees two sentences and no plural entry to fill. There is nongettextanywhere in the package.Why it matters: every user-facing string is meant to be translatable, and this one cannot be translated correctly outside languages that share English's rule. The core's catalogue tool already extracts
ngettext(core/messages_tool.py:116) andpostulo-messages checkalready verifies that plural forms agree, so the plugin has everything it needs.Fix:
ngettext("Delivered to %(count)d service.", "Delivered to %(count)d services.", 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_catalogues.pyasserts that the catalogue holds "Delivered to %(count)d service." as an entry with a plural (msgid_plural) and no separate "Delivered to %(count)d services." entry; it fails today.tests/test_apprise.pykeeps its assertion for two lines ("Delivered to 2 services.", line 194) and gains one for a single line ("Delivered to 1 service.").Fixed by pull request #23.