Repository navigation
feat(spec,cli): i18n.sourceLocale names the inline text's language apart from the users' defaultLocale - #33357
Conversation
…art from the users' defaultLocale os lint, os i18n check and os i18n extract read i18n.sourceLocale (else i18n.defaultLocale, else 'en') as the language the inline labels are written in; their --default-locale flag overrides it. A stack that declares no sourceLocale reads exactly as before. Claude-Session: https://claude.ai/code/session_017xRBcSSA3H2jkpZCNuJyw2 Co-authored-by: Claude <noreply@anthropic.com>
… teach sourceLocale; changeset Claude-Session: https://claude.ai/code/session_017xRBcSSA3H2jkpZCNuJyw2 Co-authored-by: Claude <noreply@anthropic.com>
The extractor module's export set is pinned to what it offered before the walk moved to @objectstack/lint; the shared source-locale reading belongs with the coverage gate that owns the rule. Claude-Session: https://claude.ai/code/session_017xRBcSSA3H2jkpZCNuJyw2 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 7 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 182 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin abb1da85aa3a69bec3ee8ca3fa861688e289ccb7 && git checkout abb1da85aa3a69bec3ee8ca3fa861688e289ccb7
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin e9884e199ec237004dc210d7c8b08e3615b5b469 bbf55f564550b67ba7a1fe46013afe6db77148e3 && git checkout -B drift-repro e9884e199ec237004dc210d7c8b08e3615b5b469 && git merge --no-ff bbf55f564550b67ba7a1fe46013afe6db77148e3
node scripts/docs-audit/affected-docs.mjs --json e9884e199ec237004dc210d7c8b08e3615b5b469
|
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract-review-claim: session_01FEkQ5nhu4dRbKVQKDB4CDB · head 34ec0e4 · 2026-11-14T19:09Z |
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract reviewServed-tier: Read for this record: card #33232 (body, triage 6874060759, claim 6878868326, relayed os-dev-report 6881427009), PR #33357 (body, 14-file list, net diff against ① Derived judgments
② Semver levelClause-②: yes — correct. The PR body and the changeset both carry the line, and the diff widens a published schema's accept set and its exported input type.
③ Boundary flags
④ Design judgment
The design holds for the card's scenario. One key carried two facts; the new key separates them, defaults to today's reading, uses the same
Implementing files
Break attempts that held:
Implemented-by: VERDICT: PASS |
…a declared sourceLocale On a stack declaring i18n.sourceLocale, os lint / os i18n check gate the users' defaultLocale and os i18n extract scaffolds it even when supportedLocales omits it or no bundle for it exists yet (an explicit --locales list is still the whole set). A stack without sourceLocale reads as before. The sourceLocale describe carries the serving-layer caveat, and the strict-mode help and closing hint say non-source locales. Claude-Session: https://claude.ai/code/session_017xRBcSSA3H2jkpZCNuJyw2 Co-authored-by: Claude <noreply@anthropic.com>
…g caveat Claude-Session: https://claude.ai/code/session_017xRBcSSA3H2jkpZCNuJyw2 Co-authored-by: Claude <noreply@anthropic.com>
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract-review-claim: session_01FEkQ5nhu4dRbKVQKDB4CDB · head 18a9229 · 2026-11-15T04:11Z |
|
review#2 · os-project-manager · session_01FEkQ5nhu4dRbKVQKDB4CDB Contract reviewServed-tier: Delta review of the hop ① Derived judgments
② Semver levelClause-②: yes — still correct, and the level is unchanged. ③ Boundary flags
④ Design judgmentFindings of the earlier record
Implementing files
New findings in the hop: nits only
Break attempts that held:
Implemented-by: VERDICT: PASS |
|
domain:spec#2 · sunhaolin · session_017xRBcSbLCxEmyHf9upz3pz 维护者速读 · PR #33357 @
|
Fixes #33232
Clause-②: yes
Metadata-protocol: added
Skills-docs: follow-up #33635 —
skills/objectstack-i18n/SKILL.md(itsi18nkey table and--default-localemention need asourceLocalerow).content/docs/ui/translations.mdxand theos lintflag row incontent/docs/deployment/cli.mdxare updated here.维护者速读
i18n配置新增可选的sourceLocale,表示内联元数据文字是用哪种语言写的;defaultLocale仍只表示用户的默认语言。os lint、os i18n check、os i18n extract把它当作源语言读取。i18n.defaultLocaleis both the users' default language and the authoring (source) language — an English-authored app that defaults users to zh-CN gets 446 false "missing en" lint gaps and loses its zh-CN coverage check #33232。下游应用用英文写元数据、给用户默认中文时,lint 误报 446 条"缺 en 翻译",真正缺的中文却一条也不报。--default-locale照旧可以覆盖。回滚即 revert。packages/cli/src/utils/i18n-coverage.ts的resolveSourceLocale,以及packages/spec/src/system/translation.zod.ts的新键。sourceLocale(见 Acceptance notes),本 PR 只改工具链。What changes
TranslationConfigSchema(the stack'si18nblock) gains an optionalsourceLocale, validated by the sameLocaleSchemaasdefaultLocaleand, like it, not required to be one ofsupportedLocales. Absent, it isdefaultLocale. The near-miss spellingssourceLanguage,authoringLocaleandauthoringLanguageare refused withsourceLocaleas the suggestion.resolveSourceLocaleinpackages/cli/src/utils/i18n-coverage.ts(sourceLocale, elsedefaultLocale, elseen), feedscomputeI18nCoverage(os lint,os i18n check) andos i18n extract.--default-localekeeps working on all three commands and still wins for one run; its help text now says it overrides the source locale.os i18n check --jsonkeeps itsdefaultLocalefield name and carries the source locale that was used.content/docs/ui/translations.mdx, the regeneratedcontent/docs/references/system/translation.mdx, and one row ofcontent/docs/deployment/cli.mdx(a declared surface breach: the row's sentence became false).packages/spec/authorable-surface/system.jsonregenerated.Tests
translation.test.ts:sourceLocaleis optional and canonicalised, a non-tag is refused atsourceLocale, and the 3 near-miss keys are answered.i18n-coverage.test.ts: in the downstream shape (defaultLocale: 'zh-CN',sourceLocale: 'en', English inline labels, one missing zh-CN row) there are zeroenfindings and exactly one zh-CN gap (a warning, an error under strict); the override wins; with the key absent the report deep-equals the reading before the change.i18n-extract.test.ts:resolveSourceLocale's order;enis filled from the source, and the zh-CN row is kept.resolveSourceLocalemutated to stop readingsourceLocale→ 5 failed / 47 passed; restored to HEAD.@objectstack/cliunit 417 files / 5959 tests pass;@objectstack/spec840 files / 26838 tests pass; both typechecks exit 0.Acceptance notes
defaultLocale, noti18n.sourceLocale, as the authored label's language — withdefaultLocale: 'zh-CN'and nofallbackLocale, anenrequest is served the zh-CN row instead of the English inline label #33634: the REST metadata read (packages/rest/src/meta-item-read-gate.tsmetaTranslateOptions) passesdefaultLocaleas the authored label's language. For a stack withdefaultLocale: 'zh-CN'and nofallbackLocale, anenrequest is served the zh-CN row instead of the English inline label (measured on the built resolver; the HTTP door was not booted). This exists today, independent of this PR. The workaround, declaringfallbackLocale: 'en', is in the changeset.skills/objectstack-i18ndoes not teachi18n.sourceLocale(the inline text's language, apart from the users'defaultLocale) #33635 (theSkills-docs:line above).sourceLocale. This goes to i18n: the serving layer readsdefaultLocale, noti18n.sourceLocale, as the authored label's language — withdefaultLocale: 'zh-CN'and nofallbackLocale, anenrequest is served the zh-CN row instead of the English inline label #33634, not to this PR.Verification
node scripts/pm/dispatch-gates.mjs --commandson the actual diff derived 115 commands (the seat's 78 plus 37); all 115 exit 0, and--ranreconciles 115 derived / 115 run / 0 NOT-MEASURED / 0 UNRUN. After the last commit (a function move insidepackages/cli), the 56 commands derived for its 4 files reran and all exit 0. Line budget: 346 changed lines (+318 / −28) over 14 files.🤖 Generated with Claude Code
https://claude.ai/code/session_017xRBcSbLCxEmyHf9upz3pz