A cover letter is rendered declaring English, whatever it is written in #65

Closed
opened 2026-09-06 16:05:57 +00:00 by tiagoagueda · 0 comments
Owner

What is wrong

documents/themes/base_letter.html opens:

<html lang="en-GB">

Hard-coded. The CV theme beside it does the right thing already:

<html lang="{{ cv.language|default:'en-GB' }}">

because CV has a language field. CoverLetter has none — it has a kind and a body
and no way to say what language the body is in. So a letter written in Portuguese to a
Portuguese employer is produced as a PDF that declares itself English, and there is not
currently a field that could fix it.

Why it matters more than it looks

This is the document that gets sent. Once it leaves Postulo:

  • a screen reader reading the PDF pronounces Portuguese with English rules — and the
    person reading it that way may well be the recruiter deciding on the application;
  • so does anything else that respects the declaration: a translation tool, a reading-aid,
    a PDF reader's own text-to-speech;
  • hyphenation and justification in the renderer follow the declared language, so the
    typesetting is subtly wrong in a document meant to look considered.

WCAG 2.2 success criterion 3.1.1, Language of Page, level A. The lowest level there is,
in the artefact the whole application is about.

Shape

  1. CoverLetter.language, the same field CV has, with the same "leave blank to follow
    your profile" behaviour so nobody has to fill it in.
  2. base_letter.html uses it.
  3. A migration, and a default for the letters that already exist: the owner's profile
    language is a better guess than English for everybody who is not British.
  4. While in here, check the other end: documents/themes/base_cv.html falls back to
    en-GB when a CV's language is blank, and the profile language would be a better
    fallback there too.

Classification

Bug, accessibility. Not breaking: one nullable field.

## What is wrong `documents/themes/base_letter.html` opens: ```html <html lang="en-GB"> ``` Hard-coded. The CV theme beside it does the right thing already: ```html <html lang="{{ cv.language|default:'en-GB' }}"> ``` because `CV` has a `language` field. **`CoverLetter` has none** — it has a kind and a body and no way to say what language the body is in. So a letter written in Portuguese to a Portuguese employer is produced as a PDF that declares itself English, and there is not currently a field that could fix it. ## Why it matters more than it looks This is the document that gets sent. Once it leaves Postulo: - a screen reader reading the PDF pronounces Portuguese with English rules — and the person reading it that way may well be the recruiter deciding on the application; - so does anything else that respects the declaration: a translation tool, a reading-aid, a PDF reader's own text-to-speech; - hyphenation and justification in the renderer follow the declared language, so the typesetting is subtly wrong in a document meant to look considered. **WCAG 2.2 success criterion 3.1.1, Language of Page, level A.** The lowest level there is, in the artefact the whole application is about. ## Shape 1. `CoverLetter.language`, the same field `CV` has, with the same "leave blank to follow your profile" behaviour so nobody has to fill it in. 2. `base_letter.html` uses it. 3. A migration, and a default for the letters that already exist: the owner's profile language is a better guess than English for everybody who is not British. 4. While in here, check the other end: `documents/themes/base_cv.html` falls back to `en-GB` when a CV's language is blank, and the profile language would be a better fallback there too. ## Classification Bug, accessibility. Not breaking: one nullable field.
tiagoagueda added this to the 0.2.0 milestone 2026-09-06 16:05:57 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Postulo/postulo#65
No description provided.