Skip to content

Speak the install's language: French for the whole app, signers and emails - #78

Open
thomassicaud wants to merge 1 commit into
NYLLON-SOFTWARE:mainfrom
thomassicaud:feat/i18n-fr
Open

thomassicaud wants to merge 1 commit into
NYLLON-SOFTWARE:mainfrom
thomassicaud:feat/i18n-fr

Conversation

@thomassicaud

@thomassicaud thomassicaud commented Nov 17, 2026 •

Copy link
Copy Markdown

What and why

The README lists "signing pages in English" as a gap. We run SignuDoc for contracts with French signers and a French team, so we needed the whole thing in French, and wanted to do it in a way that fits upstream and lets others add languages.

An install now picks its language under Settings, Organization. English stays the default, so existing installs don't change. French is the first translation and covers everything a person sees: the signing pages, the consent disclosure, every email, and the sender app.

How it works

  • One language per install, stored in a new app_settings.locale column (20261118100000_locale, default en, check constraint). It travels to the pages in Branding, which every layout already provides, so client components read it with useLocale(). The page's <html lang> follows it.
  • No i18n dependency. src/lib/i18n/ holds small dictionaries per area (signing, email, app, envelope, settings, server). The English object is the source and each translation is typed against it (const fr: SigningMessages = {...}), so a missing key doesn't compile. Interpolation and plurals are plain functions. Adding a language = one code in LOCALES plus one object per dictionary.
  • English output is unchanged: the existing unit, DB and e2e assertions on English text pass as they are.
  • Server errors: error classes take a UserMessage (a string or (m, locale) => string), keep an English message for logs and tests, and routes translate when they answer (localize(error)). Field errors go through localizeFieldErrors. Status codes and validation are unchanged.
  • Labels and dates built on the server for the dashboard, envelope detail, review and templates take an optional locale (default en), and dates use Intl with the install's locale.
  • Consent disclosure: each language has its own words and its own version (2026-11-13 for English, 2026-11-18-fr for French). The version and statement stored with each agreement therefore also record which language the signer read, and switching the install's language makes an open signing page ask for a reload, as a changed version already did.
  • Settings: the language is chosen from two cards with small SVG flags (Windows renders flag emoji as letters), as a radio group, keyboard and screen-reader friendly.
  • Account closure accepts the confirmation phrase in either language, so a page left open across a language switch still works.
  • The new upstream helpers from Name a password-locked PDF as locked on upload #63/Say a password is too long instead of too short or "something went wrong" #64/Refuse a setup password over 128 characters instead of shortening it #66 (password-messages.ts, pdf-preview-error.ts, EMAIL_NOT_CONNECTED_MESSAGE) take an optional locale too.

Left in English on purpose

  • Records: the stored audit trail, its export and the signing certificate PDF (including Part 11 signature meanings printed on it). A translated certificate would be a follow-up.
  • Hosted mode keeps English (landing and legal pages are untouched).
  • Messages written by libraries themselves (zod defaults, a few Better Auth messages without a code we can map).

Review notes

  • It's a large diff, but mostly mechanical: strings moved into dictionaries. Happy to split it (for example: settings column + signer side + emails first, sender app second) if that's easier to review.
  • The French consent disclosure and signer privacy notice are faithful translations of the English texts; we are having them reviewed on our side as well.
  • Pairs with Send email through Microsoft 365 with EMAIL_DRIVER=graph #75 (Microsoft 365 email): whichever lands second, I'll add the French strings for the Microsoft 365 status in Settings (already done on our deployment).

Testing

  • npm test 318 pass, npm run test:db 188 pass (Postgres 17), npm run typecheck, npm run lint (no new warnings), prettier --check on changed files, npm run build.
  • New tests: French email subjects and bodies (invitation, completion, footer, dates), French server messages (wrong code, expired link, plurals, deadline dates, schema messages, closure phrase).
  • Running in French on our self-hosted install since 2026-11-17.

🤖 Generated with Claude Code

Note

Add French localization for the whole app, signers, and emails

Adds an installation-level locale setting (English or French) that drives all user-facing text.

  • Adds a locale column to app_settings (migration), normalized and persisted through AppSettings; non-hosted organizations can pick the language in settings with a flag UI. Defaults to English.
  • Adds typed message catalogs under src/lib/i18n/ for app, envelope, signing, settings, email, and server messages, plus a French version of the electronic records disclosure, consent statements, password and PDF-preview messages.
  • Server error classes (signing, templates, people, retention, uploads, etc.) now store a locale-resolvable UserMessage while keeping an English Error.message; API routes localize response text using the install locale.
  • Signer- and sender-facing UI (login, signup, setup, dashboard, envelopes, signing, settings, downloads) reads copy from message hooks keyed by the branding locale, with locale-aware date formatting.
  • Emails (invitations, reminders, completion, void notices, verification, retention warnings, legal footer) select subject and body text from the branding locale.
  • Behavioral Change: account-closure confirmation now accepts localized confirmation phrases (auth.ts), and consent recording validates against the locale-specific disclosure version. The exported SIGN_IN_LOCKED_MESSAGE constant is removed from sign-in-security.ts.

Macroscope summarized 03aee20.

…mails

An install can now choose its language under Settings, Organization.
English stays the default, so existing installs do not change. French is
the first translation, and covers everything a person sees.

- app_settings.locale (migration 20261118100000_locale), carried to the
  pages in Branding; the page's html lang follows it.
- src/lib/i18n: small typed dictionaries per area (signing, email, app,
  envelopes, settings, server), no dependency. Each translation is typed
  against the English one, so a missing message does not compile.
- Signing pages, the consent disclosure and every email to signers,
  copy recipients and senders.
- The sender app: dashboard, envelopes, templates, settings, sign-in,
  sign-up, setup, navigation, contact, 404, the signer privacy notice,
  and the labels and dates the server builds for those pages.
- API errors are translated where they are sent; error classes keep an
  English message for logs and tests.
- Consent disclosure: each language has its own words and version
  (2026-11-18-fr), so the stored agreement records which language the
  signer read.
- Settings shows the two languages as cards with SVG flags (Windows draws
  flag emoji as letters).
- Account closure accepts the confirmation phrase in either language.

Records stay in English: the stored audit trail, its export and the
signing certificate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 17, 2026

Copy link
Copy Markdown

@thomassicaud-asi is attempting to deploy a commit to the Basic Intelligence Team on Vercel.

A member of the Team first needs to authorize it.

@greptile-apps

greptile-apps Bot commented Nov 17, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The language choice reaches the main sender and signer workflows on self-hosted installs.

Fix the completion page before merging; the two remaining translation gaps are non-blocking.

Findings

  1. P1 Signing completion page crashes ▶
  2. P2 Signature meaning stays English ▶

Summary

Adds an install-wide language setting and French translations for the sender app, signing pages, emails, and server replies.

  • Administrators can choose English or French for the whole install.
  • Signing pages and consent use the install’s language.
  • Sender and public install pages can show French text.
  • Server replies use the install’s language for user-facing errors.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Organization language setting] --> B[Stored install settings]
  B --> C[Branding and language helpers]
  C --> D[Sender and signer pages]
  C --> E[Emails and server replies]
  D --> F[Language-specific disclosure version]
  F --> G[Server checks version before saving consent]
Loading

Reviews (1) · Last reviewed commit: "Speak the install's language: French for..." · Reviewed by Greptile

</main>

<PublicLegalFooter />
<PublicLegalFooter labels={messages.footer} />

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Signing completion page crashes. SigningDoneShell runs on the server, but PublicLegalFooter is a client component. Passing messages.footer now sends its poweredBy function across that boundary, which Next.js cannot serialize. Every visit to the completion page fails, in either language. Let the footer read its own messages, pass only plain values, or make the shell a client component.

Comment on lines 1136 to 1140
<p className="text-xs font-semibold text-(--tertiary)">
Meaning of your signature
{m.finishDialog.meaningHeading}
</p>
<p className="mt-0.5 text-sm font-semibold text-(--fg)">
{part11.meaningLabel}: {part11.meaningStatement}

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Signature meaning stays English. On a French Part 11 signing page, the translated finish dialog still displays part11.meaningLabel and part11.meaningStatement directly. The server fills both from the English-only SIGNATURE_MEANING_DETAILS, so signers must confirm text such as “Approval: I approve this document.” Translate these displayed words using part11.meaning; the stored record and certificate can remain English as intended.

@greptile-apps

greptile-apps Bot commented Nov 17, 2026

Copy link
Copy Markdown

Comments Outside Diff

These findings could not be posted inline.

  • P2 Date preview differs from PDF src/components/signing/signing-live-shell.tsx:445 ▶

    Date preview differs from PDF. French date fields now show words such as “17 novembre 2026,” but buildSigningSubmissionPayload does not send that date text. The server still uses the English-only formatLocalSigningDate, and the PDF prints that stored value. Use the same language for the displayed date and the final stamp so signers see what will go on the document.

This branch has not been deployed

No deployments
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