feat(cms): enable Payload localization — hu default + en (MITHOME-110)
CI Pipeline with Test Management / 🧪 Run Tests & Generate Reports (push) Waiting to run
CI Pipeline with Test Management / 🐳 Docker Integration Tests (push) Blocked by required conditions
CI Pipeline with Test Management / 🏗️ Build Docker Image (push) Blocked by required conditions
CI Pipeline with Test Management / 📊 Generate Test Summary (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🧪 Run Tests & Generate Reports (push) Waiting to run
Test Reporting & Gherkin Analysis / 📊 Analyze Test Coverage (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / 🔄 Sync with Linear (push) Blocked by required conditions
Test Reporting & Gherkin Analysis / ⚡ Performance Monitoring (push) Blocked by required conditions

payload.config.ts: localization: { locales: ['hu','en'], defaultLocale:
'hu', fallback: true }. URL/routing side is separate (MITHOME-114).

Proved the mechanism on a real field rather than a throwaway one:
Common.buttons.* (contact/learnMore/webmail/sendMessage) marked
localized: true — these are genuinely translatable UI labels, so this
doubles as a first, correct slice of the full MITHOME-111 retrofit
instead of being disposable test scaffolding.

Gotcha discovered and documented in the migration script: marking an
existing field `localized: true` after data was already written non-
localized makes that value unreadable via `locale: defaultLocale` (the
storage shape changed) — the migration script must be re-run so it
gets rewritten under the localized shape. This will matter again for
the full MITHOME-111/112 retrofit.

Verified: Local API round-trip (set en, defaultLocale/hu re-seeded via
re-running the migration script) — hu reads "Kapcsolatfelvétel", en
reads "Contact". Real browser: admin UI locale switcher (hu/en) in the
top bar, fields show "— hu"/"— en" per-locale labels, switching
locale swaps the visible value correctly on the Common global editor.
build/lint/tsc/test (58 passed) all clean.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Do Siki
2026-09-10 13:07:36 +02:00
co-authored by Claude Sonnet 5
parent 1b587ac373
commit 6589289878
3 changed files with 33 additions and 5 deletions
+13 -5
View File
@@ -1,6 +1,14 @@
import type { GlobalConfig } from 'payload'
/** Mirrors CommonContent (proto/src/content/types.ts) — MITHOME-87. */
/**
* Mirrors CommonContent (proto/src/content/types.ts) — MITHOME-87.
*
* `buttons.*` localized: true (MITHOME-110) — ez a lokalizáció-mechanizmus
* bizonyítéka (admin nyelvváltó + Local/REST API locale param), és egyben
* előremutató, helyes darabja a MITHOME-111 teljes retrofitnak: ezek
* ténylegesen fordítandó UI-feliratok. A többi mező itt még nem lokalizált,
* azt a MITHOME-111 teljes körűen elvégzi.
*/
export const Common: GlobalConfig = {
slug: 'common',
admin: {
@@ -11,10 +19,10 @@ export const Common: GlobalConfig = {
name: 'buttons',
type: 'group',
fields: [
{ name: 'contact', type: 'text', required: true },
{ name: 'learnMore', type: 'text', required: true },
{ name: 'webmail', type: 'text', required: true },
{ name: 'sendMessage', type: 'text', required: true },
{ name: 'contact', type: 'text', required: true, localized: true },
{ name: 'learnMore', type: 'text', required: true, localized: true },
{ name: 'webmail', type: 'text', required: true, localized: true },
{ name: 'sendMessage', type: 'text', required: true, localized: true },
],
},
{