Skip to content

feat(seeds): draft the website's wording in nine more languages - #1213

Merged
Ardnived merged 6 commits into
mainfrom
claude/feat-wm-web-translations-nine-locales
Nov 19, 2026
Merged

Ardnived merged 6 commits into
mainfrom
claude/feat-wm-web-translations-nine-locales

Conversation

@Ardnived

@Ardnived Ardnived commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Adds wm-web-translations seed files for ru, it, es, fr, de, pt-BR, cs, uk, bg (seeds/wm-web-translations/data.<locale>.json), every key of the English file except the video tab (dropped on purpose: the new player ships its own labels, Videos play on a maintained player, with controls in every language WeMeditateWeb#242).
  • Adds a wm-web-locales seed script that writes and publishes each of those locales on its own. translations only loads English for this global, and it would also rewrite the app global's English and every atlas locale, so it is the wrong tool for loading the site's languages.
  • Moves the per-locale loop both scripts need into TranslationGlobalsImporter, so neither script subclasses the other (The player and site speak every visitor's language WeMeditateWeb#163's notes ask for the wm-web branch to be generalised).
  • The drafts are machine-assisted and unreviewed by speakers, by owner decision (2026-11-18). Each key comes from the old wemeditate.com translations where they exist, then wording already in the atlas seed, then the model's own. A native speaker reviews after launch.

Change outline

A responsibility moved: the loop that seeds one data.<locale>.json per locale, and the write under it, now sit in a base both translation-global scripts extend.

 seeds/
 ├── lib/
-│   └── BaseImporter.ts          # every importer extends this
+│   ├── BaseImporter.ts          # every importer extends this
+│   └── TranslationGlobalsImporter.ts
+│                                # seedLocaleFiles(): one data.<locale>.json per locale, published alone
+│                                # writeGlobal(): _status + publishSpecificLocale, moved off TranslationsImporter
 ├── translations/import.ts       # wm-app English, wm-web English, the atlas's ten locales
-└── wm-web-locales/import.ts     # extends TranslationsImporter for writeGlobal, forbids its import()
+└── wm-web-locales/import.ts     # one seedLocaleFiles call, nothing else

Both loops become one call. prepare is the only thing that differed: the atlas's English pass holds back the two groups that carry live production data.

 TranslationsImporter.import()                     seeds/translations/import.ts
   seedWmApp()    → writeGlobal(wm-app-translations, en)
   seedWmWeb()    → writeGlobal(wm-web-translations, en, publish)
   seedAtlas()
-    for locale of ATLAS_LOCALES                   # load, check _meta.locale, strip, write
-      readAtlasGlobal(en) → fillBlanks(emails, event.title)
-      writeGlobal(sy-atlas-translations, locale, publish)
+    seedLocaleFiles({ slug, locales: ATLAS_LOCALES, dataFile, prepare })
+      prepare(data, en) → readAtlasGlobal(en) → fillBlanks(emails, event.title)

 WmWebLocalesImporter.import()                     seeds/wm-web-locales/import.ts
-  for locale of WM_WEB_TRANSLATION_LOCALES        # the same loop, written again
-    writeGlobal(wm-web-translations, locale, publish)
+  seedLocaleFiles({ slug, locales: WM_WEB_TRANSLATION_LOCALES, dataFile })
+
+ seedLocaleFiles(...)                             seeds/lib/TranslationGlobalsImporter.ts
+   for locale of locales
+     load data.<locale>.json → addError and continue on a read failure
+     _meta.locale !== locale → addError and continue   # a file in the wrong slot
+     prepare?(data, locale)
+     writeGlobal(slug, data, locale, publish = true)
+       catch: continue, EXCEPT a missing Payload instance, which fails every locale

Two behaviours change with the merge, both deliberate: the atlas loop gains the _meta.locale check (all ten atlas files already carry a matching header), and an updateGlobal failure in one atlas locale no longer abandons the rest — it is reported and the run continues, as the wm-web loop and every other seed already do.

Preview

What the reviewer can and cannot see there

The nine locales read empty on the preview: nothing runs a seed on a PR environment, and this PR adds no fixture row. The locale switcher and the English document are what the link is for. The seed itself is proven by tests/int/wm-web-locales-seed.int.spec.ts, which writes all nine against a real database.

Where each language's wording came from

Counts are stored strings (a plural family counts once per form).

Language old site atlas seed kept as written machine total
ru 52 5 2 110 169
it 37 0 2 118 157
es 37 5 2 113 157
fr 41 5 2 109 157
de 40 5 2 110 157
pt-BR 0 5 2 150 157
cs 37 5 2 119 163
uk 44 5 2 118 169
bg 43 0 2 112 157
  • The old pt-br.yml is a copy of the English file, so pt-BR has no human wording at all. Old entries still reading English (TODO: Translate) were not counted as translations anywhere.
  • The Sahaja Yoga glossary global (SahajCloud#885) never merged, so "kept as written" means the brand name and Shri Mataji Nirmala Devi, which stay in Latin script in every language.
  • Where an old string was wrong for its slot (a typo, a different control such as "Per Saperne di Più" for "About Meditation", or a string over a strict length limit), the draft replaces it and the per-key sheet says so.
  • Registers follow the old site: ru, it, es, de informal; fr, cs, uk, bg formal. pt-BR has nothing to follow and uses "você".

How the runner handles a locale

translations (seeds/translations/import.ts) loads one file, data.en.json, for wm-web-translations. wm-web-locales hands the nine locales in WM_WEB_TRANSLATION_LOCALES (seeds/lib/dataFiles.ts) to seedLocaleFiles, which checks each file's _meta.locale, strips _meta, and calls writeGlobal(…, publish = true): updateGlobal with _status: 'published', draft: false and publishSpecificLocale: locale. _status is a per-locale column (localizeStatus), so each locale is published without touching English or the others. A failure in one locale is reported and the rest still run — except a missing Payload instance, which fails every locale and so is re-thrown rather than swallowed nine times.

Publishing does not offer a language. wm-web-config.availableLocales does, and its validator refuses a non-English locale whose translations are unpublished (src/fields/availableLocalesField.ts). So the production order is: run this seed, then widen availableLocales. The integration spec asserts exactly that order.

Plurals

lib/i18n.ts in WeMeditateWeb selects with Intl.PluralRules, so the full CLDR family is readable. ru and uk carry one/few/many/other, cs carries one/few/other, the rest one/other. Invariant abbreviations repeat the same string in each required form.

Test results

  • Lean gate: ✓ .claude/skills/pr-prep/check.sh — lint, format, typecheck, test-suite typecheck, unit lane (3895 tests, 82 s).
  • Targeted specs: ✓ tests/int/wm-web-locales-seed.int.spec.ts (7), tests/int/wm-web-translations-seed.int.spec.ts (7), seeds/tests/atlas-translations-import.test.ts (9) — the last one is what holds the atlas loop through the merge.
  • Build: N/A — no src/ runtime change beyond the seed route's new case.

What each spec holds:

  • tests/unit/translation-globals-importer.spec.ts: seedLocaleFiles re-throws the missing-Payload contract violation instead of reporting a clean run, and refuses a file whose _meta.locale names another language before any write. Both fail against the code they replace.
  • tests/unit/wm-web-translations-locales-seed.spec.ts: each locale has exactly English's key set minus video, every placeholder in the English string survives and none is invented, the plural forms the language needs are present, no blank or padded value, no strict limit exceeded.
  • tests/unit/seed-data-files.spec.ts, translations-seed-meta.spec.ts, seed-pagination.spec.ts: the nine files are registered for upload, quote the schema shape, and the new script states its floor.
  • tests/int/wm-web-locales-seed.int.spec.ts: the nine publish, a Slavic plural family is stored in full, the seed is idempotent, and wm-web-config then accepts all ten languages and still refuses an unpublished one.

Not done here

Nothing was written to production. Loading and switching on the languages is a separate, owner-approved step; its procedure is in the handoff.

Notes for reviewer

The shared base is the judgement call worth checking. The adversarial review asked for one loop and no inheritance; writeGlobal and the loop both need BaseImporter's protected payload, logger and report, which a module-level function cannot reach, so they sit on a base the two scripts extend instead of one script extending the other. Every concrete complaint goes away with it — no forbidden import() override, no widened parent visibility, one loop — but it is inheritance, so say if you want it taken further.

Part of sydevs/WeMeditateWeb#163

🤖 Generated with Claude Code

Adds wm-web-translations seed files for ru, it, es, fr, de, pt-BR, cs, uk and
bg, and a `wm-web-locales` seed script that writes and publishes each locale on
its own. The `translations` script only ever loaded English for this global, and
it also rewrites the app global's English and every atlas locale, so loading the
website's languages needed a script that touches nothing else.

The drafts are machine-assisted and unreviewed by speakers, by owner decision.
Each key comes from the old wemeditate.com translations where they exist, then
wording already in the atlas seed, then the model's own. The video tab is left
out: the new player ships its own labels. Slavic languages carry few/many plural
forms, which the site's Intl.PluralRules-based pluralize() selects.

Tests pin every file to English's key set minus `video`, to every placeholder,
to the strict length limits and to the plural forms each language needs, and
check in an integration spec that the nine publish and that wm-web-config then
accepts all ten languages.

Part of sydevs/WeMeditateWeb#163

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@railway-app

railway-app Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

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

Service Status Web Updated
SahajCloud 😴 Sleeping (View Logs) Web Nov 19, 2026 at 3:51 am UTC
1 service not affected by this PR
  • mailpit

@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1213 November 18, 2026 22:57 Destroyed
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 18, 2026
@sydevs-bot

sydevs-bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

🤖 no session running
CI fix 1
merge queue failed on 892500e · run

recent dispatches
  • 03:13Z fix-ci · attempt 1 · session · done
  • 03:13Z fix-ci · attempt 1 · session
  • 23:20Z address-review · attempt 1 · session · done
  • 23:20Z address-review · attempt 1 · session
  • 23:12Z review-pr · attempt 1 · session · done

Written by the sydevs dispatcher. Sessions never edit this comment.

@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 18, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧐 Adversarial review

Nine data files plus one runner matches the goal's size, and the hazard WeMeditateWeb#163 named — a locale published with a tab missing renders dotted key paths — is avoided: I measured all nine against English, each carrying 13 of the 14 tabs and English's key set minus the 41 video keys. The shape question is the runner. It subclasses TranslationsImporter to reuse one method, then overrides import() so none of the parent's three seed methods may run, beside a seedAtlas that is already the same loop — and #163's notes ask for the wm-web branch to be generalised, not paralleled. The body also omits ## Change outline and ## Preview, so your first screen is provenance tables.

Findings

  • should-fix — inheritance for one method; fold the locale loop into TranslationsImporter instead (seeds/wm-web-locales/import.ts:37).
  • should-fix — body has no ## Change outline and no ## Preview, both mandatory. No thread: body-level.
  • consider — the bare catch hides the one failure writeGlobal does not report (:74).
  • consider — the 27-line header repeats the new AGENTS.md section (:8).

What was checked

  • Read whole on the branch: both importers, lib/dataFiles.ts, expectedCounts.ts, run.ts, the seed route, the new unit spec, BaseImporter.
  • Measured, not trusted: data.en.json holds 198 leaves in 14 tabs; ru/bg/cs hold 169/157/163 in 13, zero keys English lacks. The spec takes its key set from translationsSchema.json, so this is the one check against English itself.
  • Ladder: writeGlobal and publishSpecificLocale reused, not rebuilt. fillBlanks is not — held: all nine locales read {} today.
  • Consumer side: WeMeditateWeb reads 13 tabs and never video, so the omitted tab renders nowhere; availableLocalesField's gate makes seed-then-widen the only order.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

Comment thread seeds/wm-web-locales/import.ts Resolved
Comment thread seeds/wm-web-locales/import.ts Resolved
Comment thread seeds/wm-web-locales/import.ts Resolved
@sydevs-bot sydevs-bot added bot:working Lock: a cloud session is running on this item. Removed when it ends. and removed bot:working Lock: a cloud session is running on this item. Removed when it ends. labels Nov 18, 2026
`WmWebLocalesImporter` extended `TranslationsImporter` to reuse `writeGlobal`,
then overrode `import()` so none of the parent's three seed methods could run.
That forced `writeGlobal` to `protected` and two of the parent's fields to
explicit types, and left `seedAtlas` as a second copy of the same loop.

`TranslationGlobalsImporter` now holds both — `writeGlobal` and
`seedLocaleFiles`, the loop that reads one `data.<locale>.json` per locale and
publishes that locale alone — and the two scripts extend it instead of each
other. `seedAtlas` passes its live-group fill as `prepare`, which is the only
thing that differed between the two loops.

Generalising the wm-web branch this way is what sydevs/WeMeditateWeb#163's
notes ask for. The atlas loop gains the `_meta.locale` check with it: all ten
atlas files already carry a matching header.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYpoPq5ptxUh1NEysY
`writeGlobal` reports an `updateGlobal` failure itself, so the locale loop
swallows that throw and carries on — each locale is its own write. It also
throws `'Payload instance not initialised'`, which it reports nowhere, and the
bare `catch` swallowed that for every locale in turn: the run then reported
success having written nothing at all.

The spec reaches that state the only way the unit lane can, by calling
`seedLocaleFiles` with no Payload injected. It fails against the bare `catch`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYpoPq5ptxUh1NEysY
Four of the header's points — its own script, the omitted `video` tab, that
publishing does not offer a language, and not re-running it once editors own
the wording — are now in `seeds/AGENTS.md`'s `wm-web-locales` section. Keeping
two homes for them means one of the two goes stale.

What is left is the one thing a reader at the code cannot re-derive: why this
is a script of its own rather than a branch of `translations`.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjYpoPq5ptxUh1NEysY
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1213 November 18, 2026 23:34 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

Every finding of the adversarial review is built, in three commits on 892500e.

  • Inheritance for one method — TranslationGlobalsImporter holds seedLocaleFiles and writeGlobal; both scripts extend it, neither extends the other. 8eb0ba3
  • The bare catch — a missing Payload instance is re-thrown, not swallowed per locale. New unit spec, failing first. ece772f
  • The 27-line header — 10 lines, keeping only what the code cannot show. 892500e
  • No ## Change outline, no ## Preview (review body, no thread) — both written.

One departure, in ## Notes for reviewer: writeGlobal needs BaseImporter's protected members, so a base holds it rather than a free function. Still inheritance.

Gate green, plus three int specs — atlas-translations-import among them, since the atlas loop moved.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 18, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 18, 2026
sydevs-bot
sydevs-bot previously approved these changes Nov 18, 2026

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived added this pull request to the merge queue Nov 19, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 19, 2026
@sydevs-bot sydevs-bot added the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 19, 2026
@sydevs-bot sydevs-bot moved this from Awaiting to Working in SYDevelopers Technical Roadmap Nov 19, 2026
claude and others added 2 commits November 19, 2026 03:15
#1215 landed `common.general.skip_to_main`, `common.a11y.primary_navigation`,
`common.a11y.footer_navigation` and `lecture.a11y.untitled_heading` on main
after this branch forked. The nine locale files are pinned to English's key set
and to the schema's declared-key count, so the merge-queue run failed on them
while the PR's own CI, which never saw those keys, stayed green.

The four drafts are machine-assisted and unreviewed by a speaker, like the rest
of each file: nothing in the old wemeditate.com translations or in
seeds/sy-atlas-translations names a skip link or a menu. "Untitled Lecture"
follows each language's own `meditation.general.untitled` and the word that
file already uses for a lecture.

`_meta.schema_version` moves to post-#1212, 196 declared keys, matching English.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjWsEwaCCs5Eu5bp1vY
@railway-app
railway-app Bot temporarily deployed to sahajcloud / SahajCloud-pr-1213 November 19, 2026 03:20 Destroyed
@sydevs-bot

Copy link
Copy Markdown
Contributor

The merge-queue run failed where the PR's own checks were green: #1215 added four keys to the English file after this branch forked, and the nine locale files are pinned to English's key set.

Merged main and drafted the four in every language — common.general.skip_to_main, common.a11y.primary_navigation, common.a11y.footer_navigation, lecture.a11y.untitled_heading. Nothing in the old wemeditate.com translations or the atlas seed names a skip link or a menu, so all four are machine drafts, unreviewed by a speaker like the rest of each file. "Untitled Lecture" follows each language's own meditation.general.untitled.

The provenance table above is now short by four per language: each row's machine and total rise by 4.

🤖 Written by the sydevs autonomous loop — see what this is


Generated by Claude Code

@sydevs-bot sydevs-bot removed the bot:working Lock: a cloud session is running on this item. Removed when it ends. label Nov 19, 2026
@sydevs-bot sydevs-bot moved this from Working to Awaiting in SYDevelopers Technical Roadmap Nov 19, 2026
@sydevs-bot

Copy link
Copy Markdown
Contributor

The newest commit, a6f2416, is sydevs-bot's own, so it is not approved on your behalf. Read it, then say @sydevs-bot approve.

🤖 sydevs dispatcher

@Ardnived

Copy link
Copy Markdown
Contributor Author

@sydevs-bot approve

@Ardnived
Ardnived enabled auto-merge November 19, 2026 04:27

@sydevs-bot sydevs-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved for Ardnived, who wrote it: GitHub refuses an author's own approval. CI is green and the automated review has run. Enable auto-merge when you want it merged: the queue tests it against its base. 🤖 Written by the sydevs autonomous loop — see what this is

@Ardnived
Ardnived added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit 8b1a9e4 Nov 19, 2026
28 checks passed
@Ardnived
Ardnived deleted the claude/feat-wm-web-translations-nine-locales branch November 19, 2026 04:38
@sydevs-bot sydevs-bot moved this from Awaiting to Done in SYDevelopers Technical Roadmap Nov 19, 2026
sydevs-bot pushed a commit that referenced this pull request Nov 19, 2026
#1213 split `seedLocaleFiles` and `writeGlobal` out because two scripts
shared the loop. Retiring `wm-web-locales` leaves one caller, so the
abstract class, its barrel export and its own file served `translations`
alone.

Testability was the base's other claim. It does not need a class of its
own for that: the spec's `ProbeImporter` extends `TranslationsImporter`
instead and still boots no Payload, which is what makes the
missing-instance case reachable.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjY9rbp8raZqKHwTkGp
sydevs-bot pushed a commit that referenced this pull request Nov 20, 2026
#1213 took the `wm-web-locales` script and its data files, so no file
here records which locales that global holds. Restoring the count would
restate a number nothing checks; the note names the authoritative source
instead, and warns off `LOCALES`, which is the supported set.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM
Ardnived added a commit that referenced this pull request Nov 20, 2026
)

* docs(guides): keep intent and gotchas, point at code for the rest

Pilot of the intent-only documentation rule on SahajCloud's nested
AGENTS.md guides. A sentence stays only if it would change when the
system's purpose changes; mechanism (symbol inventories, constants, file
listings, retold API surfaces) is deleted, and condition lists become a
pointer to the code or spec that holds them. Every ⚠ line, #NNN
breadcrumb on a kept statement, command and sync pointer is kept.

The scripts/ inventory table was already missing five of the 34 scripts,
which is the drift this removes.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* docs(guides): keep the lane figure tests/PERF.md pins

perf-figures-pinned.spec.ts asserts AGENTS.md quotes the whole-lane figure, so
the copy cannot drift silently.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* fix(jobs): correct the queue warning the default cron disproves

`src/jobs/queues.ts` gives `default` an `autoRun` entry — `cron:
'1-59/5 * * * *'`, the class import's safety net — so the ⚠ claiming
nothing drives it was false, and `job-schedules.spec.ts` repeated the
claim in its own comment. The cut clause was the true half of that
contradiction, so it comes back with the queue named.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM

* fix(seeds): name the hook the locale note points at

Rule 2 trades a list of conditions for a pointer at the code, and this
cut took the pointer with the list: a reader had nothing to grep for.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM

* fix(seeds): say where production's locale set now lives

#1213 took the `wm-web-locales` script and its data files, so no file
here records which locales that global holds. Restoring the count would
restate a number nothing checks; the note names the authoritative source
instead, and warns off `LOCALES`, which is the supported set.

Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01Mg9rjXNwNcni76oUbfdjWM

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>

This branch was successfully deployed

No deployments
sahajcloud / SahajCloud-pr-1213 — a6f24167 Deployed Nov 19, 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

Development

Successfully merging this pull request may close these issues.

3 participants