Cover letters: the date is a fixed \"j F Y\", ungrammatical in Polish, Spanish, Hungarian and more #387
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#387
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, by reading the letter theme and rendering its date format under seventeen of the offered languages.Checked again on 2026-10-01 against
mainat0a5cad587: still present. The code is now atdocuments/rendering.py:421-430(letter_values); the theme and the lint are unchanged.The letter theme prints its date with
{% now "j F Y" %}. Since #223 the render runs insidetranslation.override(document_language(letter)), so the month is in the letter's language, but the order and grammar are still English's.Fis the month's stand-alone name. Polish, Czech, Ukrainian, Croatian, Lithuanian and Finnish use another form of the name in a date. The pattern also drops the Spanish, Portuguese and Catalan "de", the German and Danish dot after the day, and the year-first order of Hungarian, Lithuanian and Latvian. The{{ date }}placeholder usesDATE_FORMAT, so a letter that uses it prints one date spelled two ways.Where:
templates/documents/themes/base_letter.html:37; comparedocuments/rendering.py:447-456(letter_values, which builds{{ date }}withformats.date_format(timezone.localdate(), "DATE_FORMAT"));tests/test_template_lint.py:470-471, whereTEMPLATE_DATEmatches only|date:and|time:, so the{% now %}tag escaped #225's lint.What happens:
An English letter that uses
{{ date }}in its body says "30 September 2026" at the top and "30 Sep 2026" below.Why it matters: the date sits at the top of the one document an employer reads. #223 item 1 named this very line, and its fix changed the language of the date but not its format.
Fix:
letter_valuesalready computes it inside the override) and print that inbase_letter.html, so the letter carries one date spelled one way.config/formats/(in Django,Egives the month form a date uses) rather than a literal.{% now "…" %}.Related to #223 (closed), whose item 1 named this line, and #225 (closed), whose lint does not see the
{% now %}tag.Done when
tests/test_links_and_letters.py: a letter in Polish renders its date asformats.date_format(day, "DATE_FORMAT")underpl(or the named long format), and the date at the top equals the value of{{ date }}.tests/test_template_lint.pyrejects a literal format in{% now %}.