chore: redesign article localization before implementation

This commit is contained in:
Florian Sylvain committed 2026-11-01 14:57:07 +01:00
1 parent 99a74dc3a2
commit 8c4a1825ab
31 files changed
+3365 -882

No files matched your search

+17 -3
View File
@@ -82,8 +82,22 @@ Needs backend:
| /profile | Gains change email, Your data, Danger zone | Any verified user | POST /v1/auth/email/change, POST /v1/auth/email/resend, DELETE /v1/auth/email/change, GET /v1/user/me/export, DELETE /v1/user/me |
| /login?reason=account-deleted | One-time message after deletion | Public | none |
## Localization target routes
## Localization (proposed; existing routes unchanged)
Existing: /articles, /article/:id/edit, GET/POST /v1/article/, PATCH /v1/article/{id}, PATCH /v1/article/{id}/publish, PATCH /v1/article/{id}/unpublish, DELETE /v1/article/{id}.
See [localization.md](localization.md) for authoritative API and compatibility decisions. SPA: `/settings/sites/:key/languages`, `/articles?site=&lang=&tab=all|missing|review&q=&status=&author=&seo=&page=&size=`, `/article/:id/edit?ref=:sourceId`, and `?dialog=add-translation&lang=fr`. Existing `/article/new` entry remains; do not introduce `/articles/new`. Existing guards and per-version permissions remain binding. Language settings are owner-managed; readable language metadata for editors uses the permitted site metadata surface. `author` filtering is a proposed extension, not an existing API capability.
| Route | Purpose | Access |
|---|---|---|
| /settings/sites/:key/languages | Site languages, default, disable, re-enable, remove, social locale per language. The only languages route (no global Languages page) | Owner edits, others read |
| /settings/sites/:key/languages/setup | First-time setup. :key is the site it was opened from; the page lists every site with unlabelled articles | Owner |
| /settings/sites/:key/public-url | Public URL pattern (placeholders {lang}, {slug}) | Owner edits, others read |
| /articles?site&lang&tab=all\|missing\|review&q&status&author&seo&page&size | Article list. Defaults omitted; filter changes reset page | Per article permission |
| /article/:id/edit | Editor, one id per language version | Per version capability |
| /article/:id/edit?ref=:sourceId | Temporary source reference (release 2). Does not change the tracked source | Read access to the reference |
| /article/:id/edit?dialog=add-translation&lang=fr | Add translation dialog | create-translation |
| /article/:id/edit?panel=seo | Search and sharing panel | edit |
Use only `lang` and `tab` for localization list selection; no `mode` or `needs_review` synonym. No language means grouped story mode for authenticated editorial lists; `lang` selects versions; `tab=missing` selects stories without a readable selected-language version; `tab=review` selects needs-review results in the active mode. Public listing compatibility is preserved separately.
Removed: /settings/languages and /settings/languages/setup (replaced by the site-scoped routes above). The old list params `mode` and `needs_review` are gone; `tab` replaces them.
Proposed API: GET /v1/article/ adds lang, tab=all|missing|review. GET /v1/article/{id} adds lang, story_id, capabilities[], translations[] (readable only), source. POST /v1/article/ adds lang, story_id, source_article_id, copy. POST /v1/article/{id}/translations. POST /v1/article/{id}/review (release 2). PATCH /v1/article/{id}/source (release 2). GET/PUT /v1/site/{key}/languages (adds social_locale per language). GET/PUT /v1/site/{key} adds public_url_pattern. GET/POST /v1/language/setup. POST /v1/story/{story_id}/move. PATCH /v1/article/{id} accepts if_revision (conflict response). Public: GET /v1/public/site/{key}/lang/{lang}/article/{slug} and GET /v1/public/site/{key}/story/{story_id}?lang=&fallback=default. The earlier GET /v1/public/site/{key}/article/{slug}?lang= is removed.
Field name is `lang` everywhere; the public list of other versions is `alternates`, the editor list is `translations`.
Details: see Localization board tables (Public lookup and URLs, Visibility policy).