Skip to content

feat(translations): define Sahaj Atlas translation schema by view - #539

Merged
Ardnived merged 5 commits into
mainfrom
feat/atlas-translation-schema
Jul 5, 2026
Merged

Ardnived merged 5 commits into
mainfrom
feat/atlas-translation-schema

Conversation

@Ardnived

@Ardnived Ardnived commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace the placeholder sy-atlas-translations schema with the real Sahaj Atlas i18next catalog, organized into five view tabs — Common, Region, Event, Registration, Share — so translators manage all Atlas UI copy per-view in the CMS.
  • 64 leaf keys are the loss-free union across all 10 locale files; every value is a plain string (Ruby-style %{var} interpolation and i18next _one/_other plural suffixes preserved verbatim — no richText).
  • Leaf tabs (common, share) emit one JSON field; nested tabs (region, event, registration) wrap their subgroups in a group.

Changes

  • src/globals/SahajAtlasTranslations/translationsSchema.json — full rewrite (5 tabs); descriptions transcribed verbatim from the ticket appendix.
  • Key normalization: healthInfo→health_info, priorExperience→prior_experience, referralSource→referral_source, recurrence.null→no_recurrence, details.share→share (seeds the forthcoming Share view).
  • tests/int/translations-globals.int.spec.ts — updated sy-atlas-translations assertions (new tabs + representative JSON field names) and added a nested-group check (Region/Event/Registration each wrap subgroups in one group whose first field is a tabs field; leaf tabs have none).
  • src/payload-types.ts — regenerated.

Migration

  • New migration: src/migrations/20260705_160029_sy_atlas_translations_views.ts
  • Impact: on sy_atlas_translations_locales and its _sy_atlas_translations_v_locales versions table — drops the placeholder map / location / event JSON columns and adds region_*, event_*, registration_*, share (the common column is unchanged). Only placeholder data is dropped.
  • Reversible: yes — down() re-adds the old columns and drops the new ones. Pure ADD/DROP COLUMN, no FK or table-rebuild changes.

Test Results

  • Integration (translations-globals.int.spec.ts): 12 passed
  • Unit lane: 643 passed
  • Lint: ✓ No errors
  • Build: runs on the Railway PR preview (GitHub Actions doesn't build — per repo CI split)

Notes for reviewer

  • Schema is data-only + generated output — the migration was produced by db:migrations:create (all new columns are creates, not renames) and left unaugmented per the migrations rule.
  • Follow-up (app-side migration to source translations from the CMS) is tracked on sydevs/SahajAtlasWeb.

Closes #527

🤖 Generated with Claude Code

Ardnived and others added 5 commits July 5, 2026 16:38
Replace the placeholder Common/Map/Location/Event schema with the real
Atlas i18next catalog, organized into five view tabs: Common, Region,
Event, Registration, Share. Leaf tabs (common, share) emit one JSON
field; nested tabs (region, event, registration) wrap their subgroups
in a group. All 64 leaf keys are the loss-free union across the app's
10 locale files, every value a plain string (Ruby-style %{var} interp
+ i18next _one/_other plural suffixes preserved verbatim).

Key normalization: snake_case the three camelCase question keys
(healthInfo/priorExperience/referralSource) and rename recurrence.null
to no_recurrence.

Regenerates payload-types.ts.

Refs #527

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Update the sy-atlas-translations assertions for the new tabs (Common,
Region, Event, Registration, Share) and representative JSON field names
(common, locations, venues, details, form, share). Narrow the
"no group wrappers" case to wm-web, and add a sy-atlas check that the
three nested tabs each wrap their subgroups in one group whose first
field is a tabs field (leaf tabs have none) — mirroring wm-app.

Refs #527

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drops the placeholder map/location/event JSON columns and adds the
region_*, event_*, registration_*, and share columns on
sy_atlas_translations_locales and its _v_locales versions table
(common is unchanged). Generated by db:migrations:create; all new
columns are creates (not renames), with a clean inverse down().

Refs #527

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Drop the intermediate Map; assert leaf-vs-nested group counts in a
single pass over the tabs (nested → 1 group with inner tabs field,
leaf → 0), with a per-tab failure label. Same intent, less state, and
now checks every tab rather than five named labels.

Refs #527

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Per /code-review: the field-name assertion only covered 6 representative
fields, so a dropped nested sub-group (event.recurrence, event.timing,
registration.errors, registration.questions) would slip through. Assert
the full set of 10 leaf JSON fields instead.

Refs #527

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-539 July 5, 2026 16:16 Destroyed
@railway-app

railway-app Bot commented Jul 5, 2026

Copy link
Copy Markdown

🚅 Deployed to the SahajCloud-pr-539 environment in sahajcloud

Service Status Web Updated (UTC)
SahajCloud ✅ Success (View Logs) Web Jul 5, 2026 at 4:18 pm

@Ardnived
Ardnived merged commit d1139f2 into main Jul 5, 2026
2 checks passed
@Ardnived
Ardnived deleted the feat/atlas-translation-schema branch July 5, 2026 19:12
Ardnived added a commit that referenced this pull request Jul 12, 2026
* feat(seeds): atlas country slugs use ISO alpha-2 codes

Countries claim their lowercased legacy countryCode as slug (belgium ->
be) so the Atlas widget can derive the code from the slug instead of the
deprecated legacyData.countryCode. Countries sort first in
buildRegionSlugs, so the two-letter slugs are always theirs; a missing or
malformed code falls back to the name-based slug.

Refs #556

Co-Authored-By: Claude Fable 5 <[email protected]>

* fix(events): resolve webPath when selected without webUrl

ensureWebPathDeps only injected _status into an include-mode select when
webUrl was requested, but webPath is publish-gated too — so
select[webPath]=true alone stripped _status before the afterRead hook
and the path always read null. Inject both deps whenever either path
field is selected.

Refs #556

Co-Authored-By: Claude Fable 5 <[email protected]>

* test(regions): cover ISO country slugs in webPath chains and geojson

Pin the #556 contract: a country slugged with its ISO alpha-2 code
routes the code as the first webPath segment for itself and every
descendant, and a geojson feature under a country-rooted chain carries
it (selecting webPath alone — the ensureWebPathDeps regression path).

Refs #556

Co-Authored-By: Claude Fable 5 <[email protected]>

* chore(migrations): rewrite country slugs to ISO alpha-2 codes

* fix(migrations): drop duplicate sy-atlas-translations views migration

migrate:create re-emitted the #539 views delta (already applied via
20260705_160029) because it picks its diff-base snapshot by filename
timestamp and 20260705_161112 (bcp47, from a parallel branch) sorts
later but predates the views change. Replaying the ADD/DROP COLUMNs
would abort the in-process boot migration on deploy. 20260711_230013's
freshly generated snapshot reflects the full current schema, so future
migrate:create runs diff against a correct base.

Refs #556

Co-Authored-By: Claude Fable 5 <[email protected]>

* docs(migrations): document the out-of-order snapshot trap

migrate:create diffs against the newest-by-filename-timestamp snapshot,
not the last index.ts entry, so parallel-branch migrations merged out of
timestamp order leave a stale diff base and the next run re-emits
already-applied DDL (a replay aborts the boot migration). Caught in #566.

Co-Authored-By: Claude Fable 5 <[email protected]>

---------

Co-authored-by: Claude Fable 5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-539 — d808c139 Deployed Jul 5, 2026 by railway-app[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(translations): define Sahaj Atlas translation schema by view

1 participant