From d57dd53b1b106f111766b12357414ddbd85b9509 Mon Sep 17 00:00:00 2001 From: Andrey Antukh Date: Tue, 15 Sep 2026 17:53:24 +0000 Subject: [PATCH] :books: 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 --- .serena/memories/frontend/core.md | 1 + .serena/memories/frontend/translations.md | 59 +++++++++++++++++++++++ 2 files changed, 60 insertions(+) create mode 100644 .serena/memories/frontend/translations.md diff --git a/.serena/memories/frontend/core.md b/.serena/memories/frontend/core.md index 1233aaaf31..619e63a469 100644 --- a/.serena/memories/frontend/core.md +++ b/.serena/memories/frontend/core.md @@ -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`. diff --git a/.serena/memories/frontend/translations.md b/.serena/memories/frontend/translations.md new file mode 100644 index 0000000000..6991cf808c --- /dev/null +++ b/.serena/memories/frontend/translations.md @@ -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 ` + 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 .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/.po`.