Internationalisation
Internationalisation
Section titled “Internationalisation”English is the source. French ships in 2.0 and is reviewed by a human. No user-facing string is written inline in a component, ever — not even “Save”.
1. Key scheme
Section titled “1. Key scheme”Dotted paths, grouped by domain, mirroring the repository layout:
board.card.create.title "New card"board.card.create.submit "Create card"board.filter.assignee.label "Assignee"board.empty.no_columns "No columns yet"auth.login.error.invalid "Email or password is incorrect."settings.agents.key.warning "This key is shown once. Store it now."common.action.cancel "Cancel"Rules:
- One key per meaning, not per string. Two places that say “Cancel” share
common.action.cancel. - Keys describe intent, never the English text (
board.card.create.title, notnew_card_title). - No key contains a sentence. If it does, it is in the wrong namespace.
- Parameters use
{name}and are documented next to the key in the catalog comment block. - Plurals use CLDR categories as suffixes:
...count.one,...count.other(French also needs.manyin CLDR for large numbers; include the categories the language needs, not a{count === 1 ? ...}ternary).
2. Catalogs
Section titled “2. Catalogs”web/src/i18n/en.json source, completeweb/src/i18n/fr.json translated, complete in 2.0web/src/i18n/glossary.md product terms, both languagesserver/src/i18n/en.json server-rendered strings (emails, digest, OG captions)server/src/i18n/fr.json- Both catalogs have the same key set. A test asserts parity in both directions: a key present in one and absent in the other fails.
- A missing key at runtime falls back to English and logs once per key in development; in production it renders the English text, never the raw key.
- No runtime translation service, no network fetch, no
import.meta.globover remote files. Catalogs are bundled.
3. Server strings
Section titled “3. Server strings”Two kinds, handled differently:
| Kind | Example | Handling |
|---|---|---|
| Machine-facing | API error message, MCP error message |
English, stable, part of the contract. Agents and curl users read it. |
| Human-facing | Emails, digest, OG captions, close-out markdown | Rendered server-side from server/src/i18n/* in the recipient’s locale. |
The web client does not display the API’s English message for known codes. It maps code → its own catalog entry, and falls back to message only for unknown codes. This keeps errors localised without translating the contract.
The recipient’s locale is stored on the user (users.locale, en default, set at signup from Accept-Language and changeable in settings). Anonymous surfaces use the Accept-Language header with English as the default.
4. Dates, numbers, times
Section titled “4. Dates, numbers, times”- All formatting goes through
Intl.*with an explicit locale and, for dates, an explicit IANA timezone. Never a hard-coded format string, nevertoLocaleString()without arguments. - Board card dates: short (
28 Nov), relative for recent activity (3 min ago,yesterday) — implemented withIntl.RelativeTimeFormat, not a hand-written table. - Counts use
Intl.NumberFormat; code-like values (ids, positions, shortcuts) stay in mono and are not localised. - The digest uses the account’s timezone; the UI shows dates in the account’s timezone with the zone named in settings.
5. French specifics
Section titled “5. French specifics”- Typographic apostrophe
’everywhere in UI copy, and inside string literals it must be the same character (quelqu’un, notquelqu'un). A straight apostrophe inside a single-quoted string breaks the literal; mixed apostrophes render inconsistently. - Non-breaking space before
:;!?»and after«. The catalogs contain the real U+00A0, not a normal space. - Sentence case is preserved; French capitalisation follows French rules (no Title Case).
- Numbers:
1 024(narrow no-break space as the thousands separator, fromIntl). - Product terms stay untranslated when they are the feature’s name in the UI:
Klui,MCP,Webhook,RSS. Everything else follows the glossary.
6. Glossary (source of truth for translators)
Section titled “6. Glossary (source of truth for translators)”| English | French | Note |
|---|---|---|
| board | tableau | never “plateau” |
| column | colonne | |
| card | carte | |
| tag | étiquette | |
| agent | agent | feminine “une agent” avoided; use “un agent” |
| agent key | clé d’agent | |
| link | lien | |
| write link | lien d’écriture | |
| viewer / editor / admin / owner | lecteur / éditeur / administrateur / propriétaire | |
| done | terminé | the tick is “Terminer” as an action |
| pending | en attente | |
| close-out | clôture | the summary is “bilan de clôture” |
| digest | résumé quotidien | never “digest” in French copy |
| self-host | auto-héberger | |
| sign in / sign up | se connecter / créer un compte |
The glossary is a file in the repo, not a spreadsheet in someone’s drive. A new product term is added there in the same commit that introduces it.
7. Enforcement
Section titled “7. Enforcement”- Lint rule: no string literal in JSX text, no
title="…", noaria-label="…"literal, no user-facing string in athrow. The rule allows a short allowlist (data-testid, technical keys). - Parity test: both catalogs have identical key sets; no empty values.
- Unused-key test: a key present in the catalog and referenced nowhere fails after the wave it was added in (allow a
// pending:marker with an expiry wave). - Pseudo-locale test: a dev-only locale that wraps every value (
⟦…⟧) and lengthens it by 30 % is rendered in the Playwright sweep; a clipped or overflowing control fails. - Screenshot check on the three densest screens (board, card modal, settings) in
frat 390 px.
8. Workflow
Section titled “8. Workflow”- Write the feature in English, keys from the first component.
- Add the French translation in the same commit when the key set is stable (a key that will be renamed next week is not translated twice).
- Machine translation is allowed only after the key set is stable, always through the glossary, and always reviewed by a human for French.
- A translation change is a normal commit (
doc(i18n): …), reviewed like code. - The docs site keeps its own i18n; it is not this repository’s concern.