Repository navigation
feat(translations): seed atlas landing-page SEO copy in ten locales - #781
Conversation
`GET /api/atlas/seo` answers the atlas root from the `seo` group of
`sy-atlas-translations`, and no seed carried that group. Every locale's
root title fell back to its own `common.chrome.widget_label` — the
widget's name for itself, not a page title — and `description` was
`null` everywhere.
Ten titles, one description.
Each title is built from that locale's OWN already-translated strings:
`countries.title` / `common.chrome.widget_label` ("free meditation
classes") plus `compact.open` ("near you"). So a title is a
recombination of copy a translator already wrote, never a sentence this
run invented — "Kostenlose Meditationskurse in deiner Nähe" is both
halves of the German seed, joined.
A description is not. It is new prose, and `resolveRootStrings` refuses
to serve English into another locale's `<head>` on purpose (#646), so
the nine non-English descriptions are left for a translator and the
endpoint keeps sending `null` for them — exactly today's behaviour,
never a half-state. English carries both keys.
`atlas-translations-schema.spec.ts` no longer exempts `seo.` from the
English coverage check, so both keys are guarded from here. Verified
the assertion bites: with `seo` removed from `data.en.json` it fails
and names `seo.root_title` and `seo.root_description`.
Every value is inside the schema's advisory `maxLength` — titles 32-46
of 60, the description 121 of 160. Neither field sets `strict`, so the
limits do not block a save; they are the widths a result page truncates
at.
Verified against a seeded local database: `pnpm seed translations
--dry-run` reports `<locale>:seo — created` for all ten, and
`getRootSeoStrings` then returns each locale's own title with
`description` non-null for `en` and `null` for the other nine.
Refs #778
Co-Authored-By: Claude Opus 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01BR7nsviQCZzQF2s9JfZ9Pt
The endpoint's own summary said the root `title` "falls back to English and then to a constant". It has not since #739: `resolveRootStrings` exhausts the locale first, taking `common.chrome.widget_label` before it looks at English, so an unwritten locale is named in its own language rather than in ours. That asymmetry is the module's whole point, and the summary a reader meets first contradicted it. Refs #778 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BR7nsviQCZzQF2s9JfZ9Pt
…itten Review of the branch found three claims this branch falsifies or duplicates, and one contradiction it introduced. Falsified. `atlas-seo-root-strings.spec.ts` and `docs/architecture.md` both said `common.chrome.widget_label` is the live root title "where `seo` is empty" — true while no seed carried the group, false from the commit before this one. The hop is not dead: it still answers for a locale outside the ten, and for one an operator has blanked. Both now say that instead. Duplicated. The endpoint docblock enumerated all four fallback hops, which `rootStrings.ts` already does twice at greater length. Enumerating it a third time is what let it go stale in the first place, so it now states the contract a consumer needs — `title` is never blank, and never another language's while the locale has words of its own — and names `./rootStrings` as the one place the order lives. Contradicted. `atlas-translations-schema.spec.ts` calls `seo` not widget-facing in one test and, since the exemption came off, required it under a test titled "covers every widget-facing key". Renamed to what it now checks — every key the seed owns — with the reason stated: English is the one locale where a blank landing description is an omission rather than the `null` the endpoint answers with on purpose. Not taken: seeding `root_title` for English alone and letting each locale's `widget_label` answer the rest. It is the cheaper change and it keeps one copy of the phrase per locale, but a widget's self-label is not a page title — that gap is the defect #778 opens with, and "near you" is the search intent the landing page is for. Refs #778 Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01BR7nsviQCZzQF2s9JfZ9Pt
|
🤖 no session running recent dispatchesWritten by the sydevs dispatcher. Sessions never edit this comment. |
sydevs-bot
left a comment
There was a problem hiding this comment.
🧐 Adversarial review
The diff is the right size for #778. Ten titles, one description, nothing under src/. The stale-claim sweep missed one line, in the file this PR calls canonical.
Two of the ticket's open questions are answered in the PR body, not by the reviewer. Seeding seo makes the group seed-owned, so the seed outranks an operator (question 2). The nine titles were drafted here, not by a translator (question 1). Both arguments are good. Neither call is yours yet.
Findings
- should-fix —
rootStrings.ts:71still calls the group empty →index.ts:425 - should-fix — a seed run deletes an operator's description →
data.de.json:275 - consider — nine
<head>strings nobody fluent has read →data.cs.json:277 - consider — the renamed test claims more than it asserts →
schema.spec.ts:248
What was checked
Read #778, the diff, rootStrings.ts, translations/import.ts, the seo schema, and seo.php in SahajAtlasWordpress. Titles measure 32–46 against 60, description 121 against 160. Grepped for stale seo claims.
🤖 Written by the sydevs autonomous loop — see what this is
Generated by Claude Code
`rootStrings.ts:71` still called the group blank until someone writes it. Ten seeds in this branch make that false, and the endpoint docblock names this file as the one place the chain is written down — so the survivor of the stale-claim sweep sat in the file the sweep pointed at. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RCPWTjvtu2VS5uNukAeuiE
…ribed Seeding `seo` in ten locales makes the seed its owner: the importer replaces the whole group on every run, so a description typed into the admin is gone on the next `pnpm seed translations`. Nine strings still told an operator or a host the opposite, and the decision lived only in the PR body. The three that make a promise now name the seed file instead — the field description an operator reads in the admin, the OpenAPI schema a host reads, and `rootStrings.ts`'s own header, which adds the `fillBlanks` condition for handing the group back. The other six said "operator-written" where they meant "lives on sy-atlas-translations". Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RCPWTjvtu2VS5uNukAeuiE
"covers every key the seed owns" claimed more than the filter checks: the seed does own English `emails` and `event.title`, through the defaults `fillBlanks` merges in, and the two lines below exempt both. What the assertion actually covers is the keys this file carries. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_01RCPWTjvtu2VS5uNukAeuiE
|
Addressed the adversarial review — three adopted, one left open. Pushed
Lean gate green: lint, both typechecks, 1961 unit tests. Generated by Claude Code |
Ardnived
left a comment
There was a problem hiding this comment.
Add translations for the missing root_description in every locale
The reviewer's call on #781, open question 2: every locale carries a `root_description`, not English alone. The endpoint still never falls back — an eleventh locale gets `null`, not our sentence — so this changes the data, not the rule #646 set. Each description recombines strings that locale's translator already wrote: `countries.title`, `compact.open`, `online.title`, `common.chrome.all_classes_free`, and the rendering of "Sahaja Yoga meditation" in `registration.questions.experience` — Сахаджа-йога in ru and uk, Sahadža jóga in cs. Register follows each locale's own `compact.open`: du in de, jij in nl, tú in es, vous in fr, ön in hu, vykání in cs. Lengths 119–156 against the schema's advisory 160. ⚠ Written here, not by a native speaker. That is the same debt the open thread names for the nine titles, now doubled — nine more `<head>` strings on up to 29 domains that nobody fluent has read. Three claims this falsifies, swept: the admin field description said English only, `docs/architecture.md` counted titles alone, and `index.ts:421` still said an operator writes the copy — a survivor of cf2145d's sweep. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012tG8ZaLunkn1bEkDRrGDoi
cf2145d rewrote `root_description`'s field description in `translationsSchema.json` without running `pnpm generate:types`, so the generated docblock still carried main's wording. Regenerated, and it now matches this branch's text. Co-Authored-By: Claude Opus 5 <[email protected]> Claude-Session: https://claude.ai/code/session_012tG8ZaLunkn1bEkDRrGDoi
|
Descriptions seeded in the nine locales that had none. Pushed
The Lean gate green: lint, both typechecks, 1961 unit tests. Targeted: Generated by Claude Code |
Summary
seokeys, so neither can go missing again.Changes
seeds/sy-atlas-translations/data.<locale>.json— each gains aseogroup. Ten titles, ten descriptions.tests/unit/atlas-translations-schema.spec.ts— drops theseo.exemption from the English coverage check.src/globals/SahajAtlasTranslations/translationsSchema.json— the admin now says the group is seeded, where new copy goes, and that all ten locales carry a description.src/plugins/openapi/customEndpoints.ts— the publishedtitle/descriptionschema stops calling the copy operator-written.src/endpoints/atlas/seo/{index,rootStrings,atlasRoute}.ts,src/endpoints/responseTypes.ts— the same claim, in four docblocks.docs/architecture.md,tests/COVERAGE.md,tests/unit/atlas-seo-root-strings.spec.ts,tests/int/atlas-seo.int.spec.ts— claims this branch falsifies.src/payload-types.ts— regenerated.cf2145dedited the schema JSON without it, so the generated docblock still carriedmain's wording.Preview
Test results
pnpm lint,pnpm typecheck,pnpm typecheck:tests,pnpm test:unit(1961 passed), re-run onf3e9aadtests/int/atlas-seo.int.spec.ts53 passed,tests/unit/atlas-translations-schema.spec.ts+seeds/tests/atlas-translations-import.test.ts58 passedManual verification
⚠ One thing needs a person, and it is the whole of it: nobody fluent has read these eighteen strings. Nine titles and nine descriptions, each built from fragments that locale's own translator wrote, joined by grammar calls this branch made. They land in a
<head>on up to 29 domains.ve vašem okolíwherecompact.opensaysve svém okolí. That is required grammar —svémagrees with the imperative's implied subject, and a verbless title has no subject — and the description, which does have an imperative, correctly reverts tosvém. Two deliberate divergences in one locale, from one source string.compact.open:duin de,jijin nl,túin es,vousin fr,önin hu, vykání in cs. A<head>that addresses a visitor differently from the button below it reads as two voices.registration.questions.experience—Сахаджа-йогаin ru and uk,Sahadža jógain cs,Sahaja Yogaelsewhere.Notes for reviewer
Your call on the descriptions is in.
f3e9aadwritesseo.root_descriptionin the nine locales that had none, so every locale the seed covers now carries both keys.The fallback rule is unchanged, and still #646's.
resolveRootStringsnever serves English into another locale's<head>. A locale outside these ten still getsdescription: nulland the host writes its own line. This changed the data, not the rule — which is why no source file moved for it.The copy stays seed-owned. A leaf group is one localized JSON column, replaced wholesale on write (
seeds/translations/import.ts:65-73), so a description typed into the admin lasts until the nextpnpm seed translations. New wording belongs inseeds/sy-atlas-translations/data.<locale>.json. If you want operators tuning this copy in the CMS instead, say so andseoneedsfillBlankstreatment before this is seeded to production — the mechanism already exists two functions away, foremails. That decision is written where the people it binds will read it: the admin field description, the OpenAPI schema,rootStrings.ts's own header, anddocs/architecture.md.Rejected, with a reason, since three review lenses proposed it: seed
root_titlefor English alone and let each locale'swidget_labelanswer the rest. It is cheaper and keeps one copy of the phrase per locale. But a widget's self-label is not a page title —Kostenlose Meditationskurseis the German failure #778 opens with — and "near you" is the search intent a landing page exists for. The cost is accepted and named: nine titles can now drift from thewidget_labelthey were built from.Detail
Lengths, against the schema's advisory limits. Titles 32–46 of 60, descriptions 119–156 of 160 (French is the longest). Neither field sets
strict(src/fields/translationsField.ts:35-40), so an over-length string would still save; these are the widths a result page truncates at.The titles, and what each is made of.
seo.root_titlecountries.title+compact.opencountries.title+compact.opencountries.title+compact.opencountries.title+compact.opencountries.title+compact.opencommon.chrome.widget_label+compact.opencountries.title+compact.opencountries.title+compact.opencountries.title+compact.opencountries.title+compact.openHungarian takes
widget_labelbecause itscountries.titleis still the English string — one of 22 values indata.hu.jsonthat never got translated, against at most six in any other locale and none in four of them. Filed as #782; it is not this ticket's to fix.The descriptions. Each is the English sentence's four clauses, rebuilt from that locale's own strings rather than translated from English: the imperative of
compact.open, the brand asregistration.questions.experiencespells it, the in-person/online paironline.titleimplies, andcommon.chrome.all_classes_freeas the closing sentence.seo.root_descriptionThey claim only what the seed already claims. "Every class is free" restates
common.chrome.all_classes_free; "in person or online" restates the existence ofonline.titlebeside venue events. Nothing about who teaches, or for whom, since no seeded string says it.Recombining is not copying, and Czech shows it twice.
compact.openis an imperative (Najděte kurz ve svém okolí), so its reflexivesvémagrees with the implied subject. The title has no verb, so it must readvašem. The description opens with the same imperative, so it reverts tosvém. Both are correct, which is exactly why they are worth a native read — a wrong one would look just as plausible.Verified against a seeded local database on the previous head, and by spec on this one:
pnpm seed translations --dry-runreported<locale>:seo — createdfor all ten.dereturnedKostenlose Meditationskursebefore this branch andKostenlose Meditationskurse in deiner Näheafter, which is the defect the ticket opens with.seeds/tests/atlas-translations-import.test.tsandtests/unit/atlas-translations-schema.spec.tscover the shape instead: every key is declared, non-blank, and invents no placeholder English lacks.The coverage assertion was proven to bite. With
seodeleted fromdata.en.jsonit fails and namesseo.root_titleandseo.root_description. A removed exemption that guards nothing would have passed either way. It is nameddata.en.json covers every key seeded from this file, not "every key the seed owns" — the seed does own Englishemailsandevent.titlethrough the defaultsfillBlanksmerges in, and the filter exempts both.No migration. The
seogroup is already declared intranslationsSchema.json:1070-1085; only the seed data was missing, so no column changes. The description edits there are admin copy and reach the columns not at all — they do reachpayload-types.ts, whose docblock is generated from them, which is the driftf3e9aadcorrects.Docs swept, twice. The first sweep corrected
docs/architecture.md's "whereseois empty" clause and its ownership sentence, andtests/COVERAGE.md's "operator-written". This round found three more claims the nine descriptions falsify: the admin field description said English only,docs/architecture.mdcounted titles alone, andsrc/endpoints/atlas/seo/index.ts:421still said an operator writes the copy — a survivor ofcf2145d.Security review skipped — no file in the diff matches this repo's
securityReview.triggerPattern.Efficiency, measured rather than assumed: the endpoint still costs one
findGlobalper request.widget_labelwas already seeded in all ten locales, so the second English read was already unreachable for them; this changes which??arm wins, not the query count.Closes #778
🤖 Generated with Claude Code
https://claude.ai/code/session_012tG8ZaLunkn1bEkDRrGDoi