Repository navigation
feat(seeds): draft the website's wording in nine more languages - #1213
Conversation
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]>
|
🚅 Deployed to the SahajCloud-pr-1213 environment in sahajcloud
1 service not affected by this PR
|
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 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
TranslationsImporterinstead (seeds/wm-web-locales/import.ts:37). - should-fix — body has no
## Change outlineand no## Preview, both mandatory. No thread: body-level. - consider — the bare
catchhides the one failurewriteGlobaldoes not report (:74). - consider — the 27-line header repeats the new
AGENTS.mdsection (: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.jsonholds 198 leaves in 14 tabs; ru/bg/cs hold 169/157/163 in 13, zero keys English lacks. The spec takes its key set fromtranslationsSchema.json, so this is the one check against English itself. - Ladder:
writeGlobalandpublishSpecificLocalereused, not rebuilt.fillBlanksis 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
`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
|
Every finding of the adversarial review is built, in three commits on
One departure, in Gate green, plus three int specs — 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
sydevs-bot
left a comment
There was a problem hiding this comment.
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
…anslations-nine-locales
#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
|
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 The provenance table above is now short by four per language: each row's 🤖 Written by the sydevs autonomous loop — see what this is Generated by Claude Code |
|
The newest commit, a6f2416, is sydevs-bot's own, so it is not approved on your behalf. Read it, then say 🤖 sydevs dispatcher |
|
@sydevs-bot approve |
sydevs-bot
left a comment
There was a problem hiding this comment.
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
#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
#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
) * 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]>
Summary
seeds/wm-web-translations/data.<locale>.json), every key of the English file except thevideotab (dropped on purpose: the new player ships its own labels, Videos play on a maintained player, with controls in every language WeMeditateWeb#242).wm-web-localesseed script that writes and publishes each of those locales on its own.translationsonly 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.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).Change outline
A responsibility moved: the loop that seeds one
data.<locale>.jsonper locale, and the write under it, now sit in a base both translation-global scripts extend.Both loops become one call.
prepareis the only thing that differed: the atlas's English pass holds back the two groups that carry live production data.Two behaviours change with the merge, both deliberate: the atlas loop gains the
_meta.localecheck (all ten atlas files already carry a matching header), and anupdateGlobalfailure 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
wm-web-translationsin the admin, where a seeded locale lands — https://pr-1213.cloud-preview.sydevelopers.com/admin/globals/wm-web-translationsWhat 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).
pt-br.ymlis 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.How the runner handles a locale
translations(seeds/translations/import.ts) loads one file,data.en.json, forwm-web-translations.wm-web-localeshands the nine locales inWM_WEB_TRANSLATION_LOCALES(seeds/lib/dataFiles.ts) toseedLocaleFiles, which checks each file's_meta.locale, strips_meta, and callswriteGlobal(…, publish = true):updateGlobalwith_status: 'published',draft: falseandpublishSpecificLocale: locale._statusis 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.availableLocalesdoes, 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 widenavailableLocales. The integration spec asserts exactly that order.Plurals
lib/i18n.tsin WeMeditateWeb selects withIntl.PluralRules, so the full CLDR family is readable. ru and uk carryone/few/many/other, cs carriesone/few/other, the restone/other. Invariant abbreviations repeat the same string in each required form.Test results
.claude/skills/pr-prep/check.sh— lint, format, typecheck, test-suite typecheck, unit lane (3895 tests, 82 s).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.src/runtime change beyond the seed route's new case.What each spec holds:
tests/unit/translation-globals-importer.spec.ts:seedLocaleFilesre-throws the missing-Payload contract violation instead of reporting a clean run, and refuses a file whose_meta.localenames 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 minusvideo, 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, andwm-web-configthen 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;
writeGlobaland the loop both needBaseImporter's protectedpayload,loggerandreport, 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 forbiddenimport()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