📚 Add frontend translations memory with Catalan criteria

Record the PO workflow, the sync fuzzy-flag gotcha and the
Catalan glossary and tone agreed upon while completing ca.po,
and link the new memory from the frontend core routing.

AI-assisted-by: muse-spark-1.3-contributor
This commit is contained in:
Andrey Antukh 2026-09-15 17:53:24 +00:00
parent 6954908896
commit d57dd53b1b
2 changed files with 60 additions and 0 deletions

View File

@ -37,6 +37,7 @@ See `mem:scripts/paren-repair`.
UI and packages:
- App UI components, SCSS modules, style-system boundaries, accessibility, i18n, and render performance: `mem:frontend/ui-conventions-and-style-system`.
- JS/TS packages, shared UI package, text editor, Storybook, and package builds: `mem:frontend/ui-packages-text-editor-workflow`.
- PO translation workflow and per-locale conventions: `mem:frontend/translations`.
Workspace behavior:
- Workspace state, commits, persistence, undo, repo calls, and refs: `mem:frontend/workspace-state-persistence-subtleties`.

View File

@ -0,0 +1,59 @@
# Frontend Translations
PO-based UI i18n. Files: `frontend/translations/*.po`. `en.po` is the
source of truth (`msgid` = key, `msgstr` = English); `es.po` is a
high-coverage support reference, never the base.
## Workflow
- Canonicalize with `node ./scripts/translations.js sync -l <locale>`
from `frontend/`: sorts entries, syncs `#:` comments from `en`,
deletes keys missing in `en`.
- `sync` copies ALL comment flags from `en`, including `#, fuzzy`.
Translated entries must NOT stay fuzzy: strip the flag after
translating (mirror `es.po`, which keeps fuzzy only on genuinely
untranslated entries). Fuzzy entries are excluded from
`msgfmt --statistics` translated counts.
- Canonical files carry NO `#~` obsolete blocks (`en`/`es` have zero).
Drop them; `sync` does not resurrect them.
- Definition of done: `msgfmt --check <locale>.po` exit 0 and
`msgfmt --statistics` shows 0 fuzzy, 0 untranslated.
## Entry rules
- New entries take `#:` refs from `en`; copy `#, unused`, never `#, fuzzy`.
- `en` keys with empty `msgstr` (or `#, fuzzy` + empty): translate from
`es`/source context, never leave empty.
- Entries whose `en` uses `msgid_plural` need `msgstr[0]`/`msgstr[1]`
(header: `nplurals=2; plural=n != 1`).
- Preserve verbatim: `%s`/`%d`, `{var}`/`{{...}}`, markdown
`[text](%s)`, HTML tags, `\n` positions, brand names (Penpot),
key names (Ctrl/Shift/Alt), technical terms (SVG, CSS, HSV, RGB).
## Catalan (ca) conventions
- Normative IEC/Termcat Catalan. Address the user in VOSALTRES
(2nd person plural): "Deseu", "Creeu", "Ja teniu un compte?".
Buttons/menus use short imperatives ("Crea", "Mou", "Restaura").
- Established glossary (reuse exactly, do not re-coin): layer=capa,
board=tauler, stroke=traç, fill=Emplenat, blur=Difuminat,
shadow=Ombra, clipboard=porta-retalls, delete=Elimina,
rename=Canvia el nom, shortcut=drecera, grid=graella (keep "grid"
where the file already does, e.g. grid-layout editing),
plugins/extensions UI=extensions, layout=Disposició,
gradient=Degradat, wireframing kept as loanword.
- Ela geminada uses the middle dot: Cancel·la, paral·lel, al·lega.
- ALL-CAPS source stays ALL-CAPS in Catalan; keep `$175`-style
amounts in IEC format (`175 $/mes`) only where `es` already adapts.
- Shortcut/action names (`shortcuts.*`) are noun/infinitive labels,
not sentences. Error strings are direct, no hedging.
- Same English source in different contexts may legitimately differ
(verb "Copia" vs noun "Còpia"; "Desactivat" vs "Deshabilitada"
agreeing with "drecera"). Normalize only true duplicates.
## QA before commit
- Placeholder parity per entry (singular AND each plural form).
- Balanced `[]`/`()` in markdown links; no double spaces; no glued
words around `·`; trailing spaces match the source.
- `git diff --stat` must touch only `frontend/translations/<locale>.po`.