Skip to content

Console approvals: system notes in approval history follow the browser's language, not the chosen UI language — the approvals fetch helper sends no Accept-Language #37483

Done

Description

@sunhaolin

What happens

A user whose Console language is English opens a record that went through an approval. In the approval history, the system note the server writes when excludeSubmitter removes the submitter appears in the browser's language (here zh-CN), not the chosen one:

"本步骤设置了 excludeSubmitter,提交人已从审批人中移除;没有其他人可以处理,只有特权管理员的强制处理才能决定此请求。"

Every other string on the page is English, including step labels and buttons.

Why

plugin-approvals renders this note at read time, in the request's locale (submitterExclusionNoteText(note, render) → approvalSubmitterExcluded* keys; all locales ship). The Console's approvals fetch helper sends no language, so the server falls back to the browser's Accept-Language.

  • record-approvals-renderer-*.js: K(path) builds headers as {"Content-Type", ...authHeaders()}. authHeaders (authToken-*.js) returns only Authorization. That helper serves /approvals/requests/:id, /approvals/requests/:id/actions and /remind.
  • approvalRequestsDataSource-*.js follows the same pattern for the inbox list, actions, approve and reject.
  • Compare data-adapter, which passes {"Accept-Language": client.getLocale()} for /meta/view and export.

The same request answered by the server:

Request comment on the action: "comment" row
GET /api/v1/approvals/requests/:id/actions, browser default (zh-CN) 本步骤设置了 excludeSubmitter…
same, with Accept-Language: en The request's submitter was removed from its approvers because this step sets excludeSubmitter; no one else could take it, so only a privileged override can decide it.

process_label / step_label on /approvals/requests/:id follow the same pattern (报销单审批 / 上级审核 vs Expense Report Approval / Manager Review). Any other approvals surface that shows server-rendered text is affected the same way.

Repro (18.6.0, pnpm dev of an app with an approval step that sets excludeSubmitter, e.g. HotCRM's expense report approval)

  1. Use a browser whose language is zh-CN. Choose English in avatar → Preferences → Language (objectui-locale = en, <html lang="en">).
  2. As the only possible approver, submit a record so excludeSubmitter leaves no one (route no_one).
  3. Open the record and look at the approval history.

Expected: the note is in English, the Console's language, as every other approvals string the reader sees.
Actual: the note is in Chinese, the browser's language.

Suggested direction

Send the Console's current locale on every approvals request: Accept-Language: <ui locale>, as data-adapter already does. Better still, make the shared auth-header helper add it, so other plugin pages' fetches don't repeat this.

Related but different: #27625 (Accept-Language outranks the UI language for date cells), #36463 (English words in approvals refusals).

Versions: @objectstack/console 18.6.0, @objectstack/plugin-approvals 18.6.0.

Activity

  1. added
    bug
    on Nov 26, 2026
  2. sunhaolin commented on Nov 26, 2026

    @sunhaolin
    CollaboratorAuthor

    Same cause, second surface: the notification inbox.

    Measured on the same local build (console in English through Preferences → Language, browser language zh-CN):

    1. A sales manager approves one opportunity approval and rejects another.
    2. The submitter opens the bell → Notifications. The UI is English, but the two decision notifications read 「请求已批准」 / 「请求已驳回」 with Chinese bodies, next to English rows.

    The inbox list is fetched with GET /api/v1/data/sys_inbox_message?top=20&sort=-created_at&filter=… and, like the approvals fetch, carries no Accept-Language. Replaying that request by hand:

    Accept-Language title of the two newest rows
    en Request approved / Request rejected
    zh-CN 请求已批准 / 请求已驳回

    So the server resolves keyed_text correctly per request; the console just never tells it the UI language. Whatever fixes the approvals fetch should cover the sys_inbox_message (and sys_notification_receipt) reads too.

  3. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Triage: lands in area:ux · domain:ui · Bug · priority:p1 · pm:queue · size S; rationale: filed by a person, not the fleet. In approval history, the system note follows the browser language instead of the chosen UI language, because the Console approvals fetch helper sends no Accept-Language. The reporter marked it p1 and triage keeps a person's grade, so priority:p1 is added beside the reporter's p1 label.

  4. added
    domain:ui
    pm:queue
    priority:p1
    on Nov 26, 2026
  5. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-bill · session_01Utp6Ca6EBDpTBZk8v46Jjv

    Claim: PM loop round 1 · zone o5-U (area:ux p1/p2; the maintainer, verbatim, 2026-11-25T23:27Z project thread: 「再开两个专区,接ai ux 的 p1 p2 任务」) · 2026-11-26T12:17Z · p1, unclaimed in pm:queue (triage 7186413750); not a child of a seat-owned epic
    Session: session_01Utp6Ca6EBDpTBZk8v46Jjv
    Thread session: session_01Utp6CbGtuQD4c5iyX7mqpV (card thread, mode:thread)
    Account: os-bill
    Area: o5-U
    Branch: claude/project-thread-17i5by
    Worktree: the card thread's own container
    Domain: domain:ui
    Seat: repo:objectstack#5
    File surface: ui/apps/console/src/services/approvalsApi.ts, ui/apps/console/src/services/approvalRequestsDataSource.ts, the app-shell approvals readers (hooks/useRecordApprovals.ts, views/RecordApprovalsPanel.tsx, views/approval-decision/ApprovalDecisionPanel.tsx, hooks/sharedUserFeeds.ts) as the census names them, one pin per surface, root .changeset/. A shared header helper outside this list is added only after the zone amends this claim. Stop on breach and report.
    Container & model: S, mode:thread, model: default — dispatch-gates --tier: "no path-derived mandate", effort: medium
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the Console's approvals reads and writes (objectstack, ui/apps/console + ui/packages/app-shell) | the server's read-time rendering in the request locale (plugin-approvals) | every user whose chosen UI language differs from the browser's
    Thread-read: 7186413750
    Premise: holds — the reporter measured GET /api/v1/approvals/requests/:id/actions answering zh-CN by default and English with Accept-Language: en; the thread re-reads each helper on origin/main 1af67b26
    Serial constraints cleared: no open PR touches the listed files at claim (siblings #37328 ApprovalsInboxPage.tsx, #37489 localization/ratchet, #37538 core actions are fenced out)
    Pre-claim lane: domain:ui
    Pre-claim deps: none
    Prior rulings read: accept-language,approvals → 0 hits; none; thread: none; repo: objectstack-ai/objectstack

  6. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 26, 2026
  7. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-bill · session_01Utp6CbGtuQD4c5iyX7mqpV

    os-dev-report · #37483 · draft PR #37543 · head 3312d68 · CI green (38 success, 18 skipped by path, 0 failed)

    Outcome: no source change needed on main; the PR adds pins only. The card was measured on the 18.6.0 bundles. On main the shared helper the card suggests already does it: createAuthenticatedFetch (@object-ui/auth) stamps <html lang> as Accept-Language on every /api/ call, and every reader named here goes through it.

    A1 census (on main 1af67b2):

    A2: the shared place is the helper itself; nothing to edit. A3 pins:

    • approvalsUiLocale-37483.test.tsx (app-shell): approval history, remind, pending-approvals page, and a sys_inbox_message read through an adapter built as AdapterProvider builds it.
    • approvalRequestsDataSource.uiLocale-37483.test.tsx (console): request page history and request read.
      Each asserts Accept-Language: en under <html lang="en">, with a control (no UI language → no header). Ablation: replacing the stamp with a no-op turns the 6 positive pins red, the 3 controls stay green.

    Open point: comment 7186322473 reports the inbox read without Accept-Language; the adapter has stamped it since October, and the unit pin does not reproduce that. If it still shows on a main build, it needs a browser capture of the actual request headers.

    Clause-②: no · Metadata-protocol: none · skip-changeset (test files only).
    writes: 2 (pr_create, this comment) · mcp_calls: 0

  8. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-bill · session_01Utp6CbGtuQD4c5iyX7mqpV

    Inbox header capture on a main build (S2 of the REWORK on PR #37543).

    Result: the header is present. With the console set to English on a zh-CN browser, GET /api/v1/data/sys_inbox_message carries Accept-Language: en. I could not reproduce comment 7186322473 on main.

    Setup:

    • Server: examples/app-showcase, objectstack dev --seed-admin, packages built from branch claude/project-thread-17i5by. The branch is main 1af67b2 plus two test files only.
    • Console: ui/apps/console vite dev pointed at that server, so the current ui/ source is what runs.
    • Browser: Playwright Chromium with context locale: 'zh-CN' (navigator.language = zh-CN, browser default Accept-Language zh-CN). Console language English via objectui-locale = en, the key Preferences → Language writes. Signed in as the seeded admin.
    • Headers read with request.allHeaders(), which gives what went on the wire.
    Run <html lang> navigator.language Request Accept-Language sent
    UI English en zh-CN GET /api/v1/data/sys_inbox_message?top=20&sort=-created_at&filter=… en
    UI English en zh-CN GET /api/v1/data/sys_notification_receipt?top=20&sort=-created_at&filter=… en
    UI English en zh-CN GET /api/v1/approvals/requests?status=pending&approverId=…&limit=5 en
    Control: no UI language stored zh-CN zh-CN the same three reads zh-CN on each

    Reading: the inbox read already followed the UI language before #37185, and still does. So the card's inbox evidence is not explained by any change between 18.6.0 and main. Possible causes are a build that is not 18.6.0's source, or a UI language that was not actually en at read time. Nothing on main is missing the header, so I see no new finding.

  9. objectstack-fleet commented on Nov 26, 2026

    @objectstack-fleet
    Contributor

    repo:objectstack#5 · os-bill · session_01Utp6Ca6EBDpTBZk8v46Jjv

    Close-out · 2026-11-26T13:58Z · zone o5-U · claim 7191811262: PR #37543 merged 2026-11-26T13:58Z as Part of this card. The seat ACCEPTed it at 812ae05 (7193444090, delta record 7193425919 PASS). The PR adds no source change because main already sends the UI language. It pins the approval reads and the inbox read through the real wiring, and those pins fail when the stamp is removed.

    Evidence that the header is present on main is capture 7192984653. On a local main build (Playwright Chromium, browser locale zh-CN, UI language en), GET /api/v1/data/sys_inbox_message, sys_notification_receipt and approvals/requests all carried Accept-Language: en. In the control run, with no UI language stored, all three sent zh-CN.

    Closing as completed. If a release build still shows a request in the browser's language instead of the UI language, reopen this card with a header capture from that build. Comment 7186322473's report on the inbox read could not be reproduced on main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:uxbugdomain:uip1pm:dispatchedpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions