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
+12
View File
@@ -11,6 +11,9 @@
* feltetelek).
* MITHOME-89: Partners + Media collection (MVP — feltöltés, a vágás/
* áttetszővé tétel szerkesztő külön, MITHOME-118).
* MITHOME-110: lokalizáció bekapcsolva (hu alapértelmezett, en). A mezőnkénti
* `localized: true` retrofit a Globals/LegalPages configokon külön ticket
* (MITHOME-111/112) — ez a ticket csak magát a mechanizmust kapcsolja be.
*/
import path from 'path'
import { fileURLToPath } from 'url'
@@ -45,6 +48,15 @@ export default buildConfig({
globals: [Home, About, Services, Contact, Common],
// MITHOME-109/110: hu alapértelmezett (URL-prefix nélkül), en /en/ alatt
// (Next.js routing oldala: MITHOME-114). fallback:true -> amíg egy mezőnek
// nincs angol fordítása, a magyar érték jelenik meg — nem üres oldal.
localization: {
locales: ['hu', 'en'],
defaultLocale: 'hu',
fallback: true,
},
secret: process.env.PAYLOAD_SECRET || '',
typescript: {