Skip to content

Localize ATS PDF export to the active UI language#108

Merged
vincentmakes merged 2 commits into
mainfrom
claude/localize-ats-export-sk8KP
Apr 15, 2026
Merged

Localize ATS PDF export to the active UI language#108
vincentmakes merged 2 commits into
mainfrom
claude/localize-ats-export-sk8KP

Conversation

@vincentmakes

Copy link
Copy Markdown
Owner

The ATS PDF export is generated entirely server-side via PDFKit, so its
contents didn't pick up the client-side i18n translations that the admin
UI already has. Section headings, the "Present" label, the
"Technologies:" prefix, the PDF document language tag, and PDF metadata
(Title, Subject) all appeared in English regardless of the user's
selected language.

This change adds a small server-side i18n loader that reads the existing
public/shared/i18n/*.json files at startup, and updates /api/export/ats-pdf
to translate all user-visible strings using the locale the client sends
in the request body (falling back to the stored language setting, then
English). The PDF's /Lang metadata also now matches the active locale
for screen-reader accessibility.

Adds four new keys (ats.technologies_label, ats.pdf_title_suffix,
ats.pdf_subject, ats.name_fallback) across all 8 locales, preserving
key parity enforced by the frontend tests.

claude added 2 commits April 15, 2026 17:29
The ATS PDF export is generated entirely server-side via PDFKit, so its
contents didn't pick up the client-side i18n translations that the admin
UI already has. Section headings, the "Present" label, the
"Technologies:" prefix, the PDF document language tag, and PDF metadata
(Title, Subject) all appeared in English regardless of the user's
selected language.

This change adds a small server-side i18n loader that reads the existing
public/shared/i18n/*.json files at startup, and updates /api/export/ats-pdf
to translate all user-visible strings using the locale the client sends
in the request body (falling back to the stored language setting, then
English). The PDF's /Lang metadata also now matches the active locale
for screen-reader accessibility.

Adds four new keys (ats.technologies_label, ats.pdf_title_suffix,
ats.pdf_subject, ats.name_fallback) across all 8 locales, preserving
key parity enforced by the frontend tests.
The ATS export regression slipped through because the existing i18n
checklist only covered frontend code. Server-generated output (PDFs,
file downloads, metadata tags) had no rule, no example, and no test
that could catch hardcoded English strings in src/server.js.

CLAUDE.md additions:
- New "enumerate every string the feature emits" lead-in to the i18n
  checklist so future features aren't audited only through the frontend
  lens.
- New checklist item #3 covering server-generated output, with a
  concrete serverT()/resolveLocale() example and a note about setting
  PDF /Lang metadata for accessibility.
- New checklist item #7 making the test expectation explicit: any new
  server-rendered artifact needs a regression test that compares output
  across two locales.

tests/backend.test.js — new "ATS PDF export localization" describe
block with four tests:
1. /Lang metadata matches the requested locale for all 8 supported
   languages, and the response is a well-formed PDF.
2. EN and DE PDFs differ in content after normalizing /Lang and also
   differ in byte length. This is the key regression guard — if a
   future change drops serverT() calls, the two bodies would only
   differ in the /Lang tag, which this test normalizes away.
3. Unknown locales fall back to English.
4. Requests without a locale still return a valid PDF (server reads
   the stored language setting or falls back to English).

No version bump: per CLAUDE.md, docs-only and test-only changes don't
bump versions.
@vincentmakes vincentmakes merged commit f8e2afc into main Apr 15, 2026
3 checks passed
@vincentmakes vincentmakes deleted the claude/localize-ats-export-sk8KP branch April 15, 2026 19:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants