Repository navigation
fix(settings): settings copy is written in all eleven platform languages, zh-TW reads Traditional, and sms/test answers in the caller's language (#30630) - #30734
Conversation
… and the built-in settings answers read the caller's locale Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx Co-authored-by: Claude <[email protected]>
…; sms/test and the built-in settings answers write the caller's language Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx Co-authored-by: Claude <[email protected]>
Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx Co-authored-by: Claude <[email protected]>
…locale pin Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx Co-authored-by: Claude <[email protected]>
…ms/test copy pin Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx Co-authored-by: Claude <[email protected]>
📓 Docs Drift CheckThis PR changes 4 package(s): 4 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 30 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 c6789dad23a4bf41084c21a98f3be33a8677f780 && git checkout c6789dad23a4bf41084c21a98f3be33a8677f780
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 447226b222467709ed74ca99eaf808c178656b33 953681c5889588fb0521a71584cd2a4f1140e94c && git checkout -B drift-repro 447226b222467709ed74ca99eaf808c178656b33 && git merge --no-ff 953681c5889588fb0521a71584cd2a4f1140e94c
node scripts/docs-audit/affected-docs.mjs --json 447226b222467709ed74ca99eaf808c178656b33
|
|
domain:server#5 · os-elon-musk · session_016WV4cyvF7SP65frVFAYLv7 席位核对 · ACCEPTPR #30734 · head 维护者速读(席位校正)The body's lines stand as written, read against the diff. No behaviour changes for an English caller: with no locale, or one off the platform table, every sentence is the English one served before. 席位核对
|
…ent opens with "os " check:cli-command-ids read the fragment 'os administradores. ...' as a CLI command literal. The concatenated sentence is byte-identical. Co-authored-by: Claude <[email protected]> Claude-Session: https://claude.ai/code/session_016WV4d1JeXeWGVzxc12FsUx
|
domain:server#5 · os-elon-musk · session_016WV4cyvF7SP65frVFAYLv7 席位核对 · ACCEPT (head moved)PR #30734 · head
|
Requested by Elon · project thread
Fixes #30630
Clause-②: no
Metadata-protocol: none
维护者速读
packages/services/service-sms/src/sms-plugin.ts(测试短信接上语言);packages/services/service-settings/src/settings-service.ts的runAction两处内置答复;packages/plugins/plugin-auth/src/settings-copy-locale.test.ts(逐表 11 语言 pin)。pnpm --filter @objectstack/service-sms exec vitest run src/sms-test-recipient.pin.test.ts,预期全绿,其中 zh-TW 的测试短信答复以「測試簡訊已傳送至」开头。What changes
Every module-local settings copy table (sentences composed per request, which the console's translation bundle cannot carry) now has one entry per language on the platform locale table (
PLATFORM_LOCALES:en,zh-Hans,zh-Hant,es,ar,fr,pt-BR,ru,de,ja,ko). The four languages the tables served first keep their codes (zh-CN,ja-JP,es-ES); the rest use the table's tags, the shapestorage/testuses (PR #30627). Translations are real text in every language, with no English fill.The seven tables the card names, measured on
origin/main(grepfor the four-locale key sets and forresolveLocalecallers in the three packages):plugin-authallowed-ip-ranges.tssave refusal (now exported asALLOWED_IP_RANGES_REFUSAL_COPYfor its pin)plugin-authsign-in-method-floor.tsSIGN_IN_FLOOR_COPYplugin-authmfa-required-enrollment-predicate.tsMFA_REQUIRED_ENROLLMENT_COPYplugin-authorganization-mfa-enrollment-guard.tsrefusal + save notice (two tables, one lookup)plugin-emaillive-transport-status.tsMAIL_DELIVERY_COPYen,zh-CN)service-settingslocalization-currency-lock.tsCURRENCY_LOCK_COPYservice-settingslocalization-locale-options.tsNOT_OFFERED_COPYThe lookup stays core's
resolveLocale. #30538 is closed and its fix landed:resolveLocaleis nowresolveLocaleAmong, which reads a code through the platform table's read aliases before the base-language and variant steps. So with azh-Hantkey present,zh-TW/zh-HK/zh-MOreach it and neverzh-CN;ptreachespt-BR; a code naming no table language answersundefined, which every table serves in English. No per-table copy of the reader was added.sms/test(service-sms): the handler now reads the action input'slocale(the route passesAccept-Language, else?locale) and writes every answer from a new eleven-language table,sms-test-copy.ts: the five recipient refusals, missing credential, transport build failure, log-only warning, sent, and failed. A provider's or the engine's own error text passes through verbatim, behind a lead-in outside English. The English sentences are byte-identical to before.service-settings,SettingsService.runAction): the built-inresetresult and "No handler registered for action ..." are written from a new eleven-language table,settings-action-copy.ts, indisplay.locale. English unchanged.settings-copy-locale.tsinplugin-authandservice-settings,MailDeliveryCopyLocale,SmsTestCopyLocale), so a table missing a language failstsc. Arabic and Russian counts (MFA grace days, currency usage, reset count) use their plural forms.Why
A Setup caller in French, German, Korean, Arabic, Russian, Brazilian Portuguese or Traditional Chinese read these sentences in English (or, for
zh-TW, in Simplified Chinese), andsms/testignored the caller's language entirely. The eleven-language rule (ruling F of #29349) holds every surface to the platform table.Tests
zh-TW,zh-HK,zh-CN,zh,ja-JP,es-ES,pt,en-US,fr-CA,de-AT) served its own language;zh-TWnever served the Simplified entry; an off-table code (xx,sw-KE) and no code served English.plugin-auth/src/settings-copy-locale.test.ts(5 tables), plus Russian/Arabic plural cells.plugin-email/src/live-transport-status.pin.test.ts(new top-leveldescribein the existing harness).service-settings/src/settings-copy-locale.test.ts(currency lock, not-offered, built-in action answers).service-sms/src/sms-test-copy.test.ts, including the English sentences pinned byte-identical.service-sms/src/sms-test-recipient.pin.test.tsdrives the real settings route with anAccept-Languageheader:zh-TW,zh;q=0.9answers "測試簡訊已傳送至 …,經由 twilio(id=SM_test)。";fr,de-DE,korefusals are in those languages and send nothing; no header andsw-KEstay English.service-settings/src/settings-service.test.tspins the reset result inzh-TWandruand the no-handler refusal inde-DE, English for none /sw-KE.fr-FRrow (was English); the email control (fr-FRwas English, nowsw-KE); themfa_requiredand organization-MFA unknown-locale cells (fr-FR→sw-KE,fr-FRnow French,zh-TWadded); the organization notice's "1 is a digit in every language" cell accepts Arabic's word form for one day ("يوم واحد").Acceptance notes
allowed-ip-ranges.ts): it rewrites therecoverysentence in the four languages it had. This PR translates the current one-step recovery into the seven new languages. Whichever lands second owes the four-step recovery in all eleven; a text conflict on thees-EShunk is possible.zh-Hant-TW/zh-Hans-CNare not read through the table by the shared resolver:resolveLocaleAmong's table step looks the whole code up, misses, and the variant step returns the firstzh*key,zh-CN. A caller whose display language iszh-Hant-TWtherefore still reads Simplified here and in every other bundle the resolver serves. The resolver lives inpackages/spec(outside this card's file surface); reported to the seat, not fixed here.ObjectStack SMS test message.) is unchanged: it is the message, not the answer.Verification
Head
b1014f4d(a54649c1the fix,c3f79fc1a merge oforigin/mainatbadf24df, then two test-only commits). Readings underscripts/pm/os-verify-lock.shon a shared box.Repro on origin/main (base 4bf9a2d)
With the nine edited sources restored to the base (
git restore --source=4bf9a2d7, tests from this branch), restored afterwards withgit checkout HEAD -- packagesandgit diff HEADempty:signInFloorCopy('zh-TW')is thezh-CNentry (Simplified);signInFloorCopy('fr')is English; the table's keys areen,zh-CN,ja-JP,es-ES.sms/testthrough the served route withAccept-Language: zh-TW,zh;q=0.9answeredSent test SMS to +8613*******01 via twilio (id=SM_test).Ablations (scripts/ablation-replace.mjs, anchor 1 → 0, restored to the HEAD blob, git diff HEAD empty; tests import src/)
sign-in-method-floor.ts: the lookup reads only the four old keys (resolveLocale(locale, ['en','zh-CN','ja-JP','es-ES']))settings-copy-locale.test.ts(tags/aliases served their own language; zh-TW never Simplified)sms-plugin.ts: the handler ignores the input locale (smsTestCopy(undefined))sms-test-recipient.pin.test.ts(zh-TW sent, fr / de-DE / ko refusals)Suites and typecheck
After the merge of
origin/main: closure build of the four packages (pnpm --filter 'PKG^...' … build) exit 0, then per package typecheck (withcheck:test-typecheck) andpnpm --filter PKG test:@objectstack/plugin-auth: typecheck exit 0; Test Files 228 passed (228), Tests 4088 passed, 10 skipped (4098).@objectstack/plugin-email: typecheck exit 0; Test Files 48 passed (48), Tests 805 passed (805).@objectstack/service-settings: typecheck exit 0; Test Files 70 passed (70), Tests 1195 passed (1195).@objectstack/service-sms: onb1014f4dtypecheck exit 0 (check:test-typecheck: OK); Test Files 9 passed (9), Tests 119 passed (119).Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 63 commands onb1014f4d; each run with its exit code recorded before any pipe.--ran: 63 derived, 62 run, 1 NOT-MEASURED, 0 UNRUN. NOT MEASURED:pnpm check:dual-build-cjs-loads(exit 3, PREREQUISITE NOT MET: it needs a whole-workspace build; CI runs it).check:test-source-aliasfirst went red on the newsms/testcopy pin (it read@objectstack/spec/systemfrom the build); fixed by the anchored source alias inservice-sms/vitest.config.ts, then exit 0. Every other command exited 0.pnpm lintexit 0.Generated by Claude Code