Repository navigation
Description
Summary
Make SahajCloud the single source of truth for every UI string (English included) and for the set of locales each project offers, for Sahaj Atlas and WeMeditate Web. Consumers delete their local translations and read both from the CMS.
This is a cross-repo change with no atomic commit, so this issue exists to record the merge order. Producer: SahajCloud (three children). Consumers: SahajAtlasWeb and WeMeditateWeb (one child each), each blocked on the producer landing on main and production being seeded and published. WeMeditateApp is out of scope: its schema and globals are not edited; only the shared field builder changes (rendering, types, equivalent validation).
Background
wm-web-translationsandsy-atlas-translationsalready exist, built bybuildTranslationTabs()from atranslationsSchema.json— but only the App consumes its global. The atlas widget ships 10 hand-maintained i18next bundles underpublic/locales/; WeMeditateWeb has no i18n layer (~150 hardcoded English literals, 41 screen-reader-only). Every one ofwm-web-translations' 16 keys is unused by the site;sy-atlas-translationsmirrors an old 2-namespace catalogue (23 dead keys, ~100 live keys missing).- Which locales a project offers is inconsistent:
sy-atlas-config.languages(array of{code}rows, read only by the SEOhreflangbuilder, feat(api): serve SEO metadata for an atlas route (C3) — blocks the WordPress plugin and WeMeditateWeb SSR #645) vs three divergent hardcoded lists in WeMeditateWeb (19 CMS / 10 flag component / 5 dropdown). - Payload's locale fallback is per field, not per key: a partially translated locale returns its JSON blob minus the missing keys. Payload 3.86 ships experimental per-locale publish status (
experimental.localizeStatus), which this adopts for the two web-project translations globals. - Production data: both web-project translations globals hold seed placeholders, except
sy-atlas-translations.emailsandevent.title, which are live (registration emails, auto-titles) and keep their columns and values.
Decisions (clarified 2026-09-05)
- Close WeMeditateWeb#56, SahajAtlasWeb#28, SahajAtlasWeb#167 and PR SahajAtlasWeb#168 in favour of the children below; strike item 1 of refactor(fields): adopt jsonSchema for structured json fields #597 (it lands in child 1).
- Per-locale publish status via
experimental.localizeStatusonsy-atlas-translationsandwm-web-translationsonly. "Available" =_status[locale] === 'published'; completeness is not enforced. - A reusable
availableLocalesField({ translationsSlug })(hasMany select over the CMS locales) onsy-atlas-config(replacinglanguages) andwm-web-config. Save is rejected if any selected locale's translations are not published.enis always required. Fallback for an unconfigured row is['en'];ATLAS_DEFAULT_LOCALESis deleted and the oldlanguagesrows are not copied. - Per-key English fallback happens in the CMS for API-client reads (
afterReadhook, never for managers), so consumers do no client-side merge. - Each consumer commits a generated English snapshot (
pnpm sync:translations, never hand-edited) for first paint, tests, Ladle and the CMS-unreachable last resort. Runtime always prefers the CMS. - Stay hardcoded in consumers: CMS-unreachable error copy, endonyms + brand wordmark + social platform names, editor/dev-only surfaces, CMS-block default copy.
- Translations JSON groups get a
jsonSchemaderived from the schema (typed groups inpayload-types.ts, Ajv validation); a newstrict: trueextension makesmaxLengthblock the save. - Sub-groups render as collapsibles, not inner tabs; a page tab that has screen-reader-only strings declares explicit
general+a11ysub-groups. - Atlas call sites: one i18next namespace, nested keys (
event.display.chip_full),%{x}interpolation, CMSplural: truefamilies. WeMeditateWeb: a URL whose locale is not enabled returns 404; translations cached at the SETTINGS TTL (24 h). - The
localizeStatusmigration ships drizzle-generated only: every locale of both translations globals reads Draft until an operator publishes (content columns untouched).
Merge order
SahajCloud (1) field infra ──► SahajCloud (2) atlas schema+seed ──► seed+publish prod ──► SahajAtlasWeb child
└─► SahajCloud (3) web schema+seed ──► seed+publish prod ──► WeMeditateWeb child
- Producer merges first, always. Each SahajCloud PR merges to
mainand deploys to Railway before the next starts: consumers pullsrc/payload-types.tsfrommain(pnpm types:cms), and a consumer pointed at an unmerged branch silently keeps the old shape. - After (2)/(3) deploy, an operator runs
pnpm seed:prod translations, confirms each locale shows Published in the admin, then selectsavailableLocaleson the config global. Only then do the consumer PRs open for review. - One PR per repo; no simultaneous merge.
Interim states (expected, not bugs)
- After (1) deploys: every locale of both translations globals shows Draft until published; atlas
hreflangshrinks toen; the widget (still on shipped bundles) keeps offering 10 — the safe direction. Registration emails and auto-titles are unaffected (main-row content reads). - After (2)/(3) deploy until the operator publishes and selects locales: same as above.
- WeMeditateWeb changes nothing user-visible until its child ships.
Downstream
Merge in this order. Each child restates its blocking condition in its own body.
Producer — SahajCloud
- feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705 — (1) typed JSON groups (
jsonSchema,strict), collapsible sub-groups, per-locale publish status (localizeStatus),availableLocalesFieldon both config globals, client-read English merge. Blocks everything below. - feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706 — (2) Sahaj Atlas schema rewritten by widget view; 10-locale seed published per locale;
sy-atlas-config.availableLocales. Depends on feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705. - feat(translations): rewrite the WeMeditate Web schema by page, seed and publish English, and gate availableLocales on it #707 — (3) WeMeditate Web schema rewritten by page with
general/a11ysub-groups; English seed published;wm-web-config.availableLocales. Depends on feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705. - Operator:
pnpm seed:prod translations, confirm Published per locale, selectavailableLocaleson both config globals.
Consumers — after their producer children are on main and production is seeded
- feat(i18n): source translations and the language set from SahajCloud SahajAtlasWeb#198 — widget reads
availableLocales+sy-atlas-translations, deletespublic/locales/**, commits a generated English snapshot. Blocked by feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705 + feat(translations): rewrite the Sahaj Atlas schema by widget view, seed all ten locales, and gate availableLocales on them #706. - feat(i18n): source every UI string and the locale set from SahajCloud WeMeditateWeb#80 — site reads
availableLocales+wm-web-translations, replaces every literal (incl. the 41 a11y sites), 404s disabled locales, commits a generated English snapshot. Blocked by feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705 + feat(translations): rewrite the WeMeditate Web schema by page, seed and publish English, and gate availableLocales on it #707.
Follow-ups (filed as stubs, not blocking)
- feat(fields): declarative live-preview targets, repointed by the open tab #708 — live preview for the translations globals (CMS
livePreview.url+ consumer preview routes for a global). - feat(translations): adopt availableLocales, per-locale publish status and the English merge for WeMeditate App #709 — WeMeditate App:
availableLocalesField,localizeStatus, English merge. - perf(api): cache, usage and purge coverage for /api/globals reads #710 — cache / usage / purge coverage for
/api/globals/*reads. - feat(seo): hreflang and sitemap alternates from availableLocales WeMeditateWeb#81 — hreflang + sitemap alternates from
availableLocales. - feat(i18n): CMS-owned labels for the Vidstack video controls WeMeditateWeb#82 — CMS-owned labels for the Vidstack video controls.
Verification
- Children (1), (2), (3) merged to
mainin that order; Railway deploys green; migrations applied on boot. - Production seeded; each atlas locale and web
enshow Published;availableLocalesselected on both config globals. -
GET /api/atlas/seohreflang lists the selected atlas locales;GET /api/globals/sy-atlas-translations?locale=frwith a client key returns French with English merged into blanks. - Consumer children run
pnpm types:cmsonly after their producer children are onmain; both consumer PRs merged; nopublic/locales/**or hardcoded UI literal remains for a CMS-owned key.
References
- Superseded (closed with pointers): feat(i18n): consume CMS wm-web-translations + BCP-47 locale codes WeMeditateWeb#56, refactor(i18n): source translations from SahajCloud CMS SahajAtlasWeb#28, feat(i18n): take the language set from SahajCloud, not from
supportedLanguagesSahajAtlasWeb#167, PR feat(i18n): take the language set from SahajCloud, not fromsupportedLanguagesSahajAtlasWeb#168. - Related: refactor(fields): adopt jsonSchema for structured json fields #597 (jsonSchema adoption; item 1 moved to feat(translations): typed JSON groups, per-locale publish status, and an availableLocales field gated on published translations #705), feat(api): serve SEO metadata for an atlas route (C3) — blocks the WordPress plugin and WeMeditateWeb SSR #645 (
languagesorigin), feat(access): derive the routing mode on the server, so the widget stops taking it from the script URL #644, feat(translations): define Sahaj Atlas translation schema by view #527/feat(translations): WeMeditate Web schema + BCP-47 compound locales #528 (placeholder schemas). - Builder:
src/fields/translationsField.ts; readers of live data:src/lib/translations/emailStrings.ts,src/lib/eventTitle/autoTitle.ts.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Hold Until
Projects
- StatusShow more project fieldsDone
Activity
feat(i18n): source translations and the language set from SahajCloud (#…
Ardnived commentedon Oct 8, 2026
Closing: all five children are closed (SahajCloud#705, #706, #707, sydevs/SahajAtlasWeb#198, sydevs/WeMeditateWeb#80).