Address notes: a label pasted into a sentence gives \"a address\", \"A Eircode\" and wrong agreement in translation #642
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#642
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 how the address notes are built and rendering them with the plugin's own English, German, Portuguese, French and Polish catalogues compiled into a scratch folder.The two notes the address rules produce are each one sentence with a slot, and the slot is filled at run time with a field label that has been lower-cased in Python. A noun dropped into a sentence cannot agree with it: the article is wrong in English for some labels, and in translation the gender, the case and the capital letter are wrong for most. This is the pattern #168 (closed) removed from a CV's heading, with the same two objections.
Checked again on 2026-10-01 against
mainat0a5cad587: still present;plugins/postal_rules/is unchanged.plugins/postal_rules/__init__.py:131-147(warnings_for):_("Post to %(country)s usually needs a %(part)s.")and_("A %(name)s in %(country)s usually looks like %(example)s."), filled with_lower(label_for(…)).plugins/postal_rules/__init__.py:179-182(_lower): lower-cases the translated label unless it is all capitals, contains " (", or is the literalEircode.plugins/postal_rules/__init__.py:173-176(_country_name), which returnsphones.country_name(core/phones.py:337-348): the English name, for every reader.plugins/postal_rules/locale/de/LC_MESSAGES/django.po:73-74has "eine %(part)s",locale/pt_PT/LC_MESSAGES/django.po:73-74has "um %(part)s",locale/fr_FR/LC_MESSAGES/django.po:73-74has "d'un %(part)s".core/phones.py:32-37keeps the names in English on purpose for the country list ("this is a list somebody scans for their own country"); that reason does not carry over to a sentence.resume/candidate.py:911), and on Your details under an address row (templates/partials/postal_addresses.html:99-100). On Your details the notes are computed inPostalAddressForm._post_clean(core/postal.py:226-235) and the view redirects after a successful save (accounts/views.py:177-189), so today they appear only when the page comes back with an error somewhere else. That is worth deciding at the same time: a note about a saved address that is never shown after saving is not doing its job.LABELS("Post to %(country)s usually needs a postcode.", "… a state.", "An Eircode in %(country)s usually looks like %(example)s.", and so on; one short string for each label a note can name), or a form that needs no agreement and no change of case, such as "Usually expected for %(country)s: %(part)s" with the label as the catalogue wrote it._lower.The review's issue on translated labels lower-cased in Python names
_lowerin one line; this issue is the full account for the address notes.Done when
tests/test_postal_rules.pyasserts, with English active, that an address in Germany with no street line gives a note without "a address", and that a wrong Eircode gives a note without "A Eircode". It fails today.tests/test_postal_rules.pyasserts that no msgid of the plugin puts a label placeholder after an article (a %(part)s,A %(name)s), and thatpostal_ruleshas no_lower.