Skip to content

console: a user with no personal locale gets the browser's language, never the app's declared i18n.defaultLocale (served as discovery locale.default) #33231

Closed

Description

@os-bob

Found by a downstream app on the published 18.4.0 packages (steedos-labs/os-project-blackcat-crm#67, PR #72: the app's default moved to zh-CN).

Symptom

App i18n.defaultLocale: 'zh-CN'; GET /api/v1/discovery answers locale.default: 'zh-CN'; the server notifies a no-locale user in Chinese. But the console for a user whose sys_user.locale is null, in an en-US browser, renders English (Accounts / New, <html lang="en-US">). With a zh-CN browser it renders Chinese; with sys_user.locale = 'en' it renders English regardless (correct).

Producer (downstream reading)

@objectstack/console 18.4.0 i18n runtime resolves the UI language as sys_user.locale → navigator.language → 'en'; it never reads the discovery locale.default. So the declared app default reaches the server's texts but not the UI — two faces of one setting disagree.

Suggested fix shape (for the lane to judge)

Resolve the console language as sys_user.locale → the app's declared default (discovery locale.default) → browser → en, or make the precedence of the browser vs the app default an explicit, documented setting; either way the console and the server should answer the same language for the same user.

Dedupe words: console default language · defaultLocale ignored · navigator.language · discovery locale.default · no personal locale.

Activity

  1. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    Contributor

    triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH

    Path: none

    Triage: first touch → domain:ui · p2 · pm:queue · 2026-11-14T07:46Z

    ⛔ Not a claim.

    • Row: a user with no personal locale gets the browser's language in the console, never the app's declared i18n.defaultLocale, even though discovery serves it and the server already writes to that user in it. Two faces of one setting disagree: wrong-running, p2.
    • No raise: the user can set a personal locale, which is a known remedy, though not a named one. A downstream zh-CN app hit it.
    • Fix: resolve sys_user.locale → discovery locale.default → navigator.language → en.
  2. added
    domain:ui
    pm:queue
    priority:p2
    on Nov 14, 2026
  3. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    Contributor

    domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

    Claim: PM loop round 1 · 2026-11-14T15:16Z
    Session: session_01FEkQ5oJs154mFFCPgUmnhE (card thread, dev) · seat session_01FEkQ5nWoa1Ze1QzjRTSYXD
    Account: os-project-manager
    Branch: claude/project-thread-oo19zc
    Worktree: objectstack-issue-33231
    Domain: domain:ui
    Seat: domain:ui#1
    File surface: ui/apps/console/src/languageSeed.ts, ui/apps/console/src/LocalizationFetchProvider.tsx, the browser detection in ui/packages/i18n/src/i18n.ts, their tests, root .changeset/. ⛔ No server code, ⛔ no new setting or spec key.
    Container & model: M, mode:thread, model: default tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: the console i18n runtime resolves sys_user.locale → navigator.language → en and never reads discovery locale.default | none (a personal locale is the only remedy) | every user with no personal locale in an app whose declared default differs from the browser
    Thread-read: 6874049959
    Premise: holds: ui/packages/i18n/src/i18n.ts reads navigator.language when no language is given (~L178-180 on origin/main d4fbb4db); triage 6874049959 confirmed the precedence
    Serial constraints cleared: no domain:ui card is pm:dispatched at claim time (live label read); no other ui seat holds a Claim: on these files

    Scope: sys_user.locale → discovery locale.default → browser → en (triage 6874049959), one PR, Fixes #33231. The declaration lines start at no / none; the dev measures them on the diff, and the seat amends this claim if they differ. Order: /mnt/project-files/pm-orders/ui/order-33231.md. Summons: the maintainer's 「开一个 ui 车道,派发 p1 p2 任务」 (this project, 2026-11-14T14:13Z).

  4. added
    pm:dispatched
    and removed
    pm:queue
    on Nov 14, 2026
  5. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    Contributor

    domain:ui#1 · os-project-manager · session_01FEkQ5oJs154mFFCPgUmnhE

    os-dev-report
    {
    "issue": 33231,
    "status": "done",
    "branch": "claude/project-thread-oo19zc",
    "pr": "#33309",
    "session": "session_01FEkQ5oJs154mFFCPgUmnhE",
    "premise_still_valid": true,
    "summary": "The console's UI language for a signed-in user is now sys_user.locale, else discovery locale.default, else the browser, else en, and the html lang attribute follows it. Mechanism measured: the console's seed was the server's /auth/me/localization answer, whose second rung is the request's Accept-Language, which a bare fetch fills with the browser's; so a no-locale user's seed was the browser language. languageSeed.ts now reads discovery locale.default once per page load through getSharedDiscovery (the adapter's own shared request) and states it as that read's Accept-Language when the device holds no explicit choice; LocalizationFetchProvider's every-boot read states the same value, so it refreshes the seed to the app default and both still share one request. No server change, @object-ui/i18n not edited. Measured consequence the seat ruled literal: discovery always serves a default (en for an app with no i18n block), so such apps' no-locale users get English in a zh browser; called out in the PR's 维护者速读 and Acceptance notes. Card assignee untouched; PR opened with no assignees per the order.",
    "tests": "pnpm --dir ui exec vitest run apps/console/src/languageSeed.test.ts apps/console/src/LocalizationFetchProvider.test.tsx apps/console/src/tests/localizationBootDedup.test.tsx on 1226099: Test Files 3 passed (3), Tests 38 passed (38). New pins: languageSeed.test.ts describe objectstack#33231 (rendered boot through seedTenantLanguage + preloadBootstrapLocale + I18nProvider against a fake rung server: no personal locale + default zh-CN + en-US browser renders 'zh-CN|取消' with html lang zh-CN; personal en renders 'en|Cancel'; no default served + ja browser renders 'ja|キャンセル' and states no Accept-Language), a LocalizationFetchProvider case (states zh-CN, dates 2026年10月11日, seed zh-CN), a localizationBootDedup case (seed and provider stating zh-CN share ONE localization request). Ablations via scripts/ablation-replace.mjs on 1226099 over the 3 files: seed's stated Accept-Language disabled (languageSeed.ts blob c3685942 to 198db16e) 2 failed / 36 passed, red = the zh-CN/en-US boot case (expected 'en-US|Cancel' to be 'zh-CN|取消') and the one-request case; provider preference disabled (LocalizationFetchProvider.tsx blob 16feb1f7 to 115611f6) 2 failed / 36 passed, red = the provider case and the one-request case; both restored blob == HEAD, git diff HEAD empty; personal-locale and no-default controls green under both. Console tests import the modules from source (no dist between mutation and run). Whole console project pnpm --dir ui exec vitest run apps/console/ on b3237cd: 310/311 files, 3191/3192 tests; the one red (localizationBootDedup counting the discovery read) fixed in 1226099, a test-only commit, and green above.",
    "gates": "Local: dispatch-gates --commands --repo objectstack-ai/objectstack derived 36 families (same 36 on b3237cd and 1226099); all 36 exit 0 on b3237cd and again on 1226099 (exit codes captured before any pipe, file /mnt/project-files/pm-orders/ui/33231-gates-ran.txt); --ran reconciliation on 1226099: 36 derived, 36 run, 0 NOT-MEASURED, 0 UNRUN. Also: pnpm --filter @object-ui/console run type-check exit 0 (after the @object-ui/console^... closure build, VERDICT command-exit 0); eslint on the 4 changed source/test files exit 0; check:new-line-citations 0 new, exit 0. CI check-runs on PR #33309: in_progress at report time (not waited on, per os-dev.md).",
    "dogfood_battery": "n/a — no ! in the PR title and no (narrowing) arm",
    "line_budget": "changed lines under 3,000 (5 code/test files + 1 changeset)",
    "files_changed": [
    ".changeset/33231-console-app-default-locale.md",
    "ui/apps/console/src/languageSeed.ts",
    "ui/apps/console/src/languageSeed.test.ts",
    "ui/apps/console/src/LocalizationFetchProvider.tsx",
    "ui/apps/console/src/LocalizationFetchProvider.test.tsx",
    "ui/apps/console/src/tests/localizationBootDedup.test.tsx"
    ],
    "deviations": [
    "File surface: ui/apps/console/src/tests/localizationBootDedup.test.tsx edited (a test of languageSeed + LocalizationFetchProvider; its request count had to separate the new discovery read). ui/packages/i18n/src/i18n.ts, named on the claim, was not touched.",
    "Labels: none sent on pr_create (the order names none; skip-changeset does not apply, @object-ui/console ships dist)."
    ],
    "mcp_calls": "0 — no MCP GitHub calls",
    "api_writes": "3 — git push (branch claude/project-thread-oo19zc, 4 pushes of the same branch), fleet-write pr_create (PR #33309, run 43615251233), post-stamped os-dev-report comment on #33231",
    "open_questions": [],
    "security_findings": "none",
    "out_of_scope_findings": [
    "carrier: none · noted in PR acceptance notes, not filed: a device that has never had a signed-in user renders the sign-in page in the browser language (the endpoint answers no locale before sign-in); after a change of owner on a shared browser useLanguageResetOnOwnerChange resets to the browser language for that page load. Both pre-existing and outside the ruled order for a user."
    ]
    }


    Generated by Claude Code

  6. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    Contributor

    domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

    Seat review: PR #33309 ACCEPT on head 5bf36bd9 (2026-11-14T19:10Z). Base synced (K = 59); it lands after the rerun is green.

  7. objectstack-fleet commented on Nov 14, 2026

    @objectstack-fleet
    Contributor

    domain:ui#1 · os-project-manager · session_01FEkQ5nWoa1Ze1QzjRTSYXD

    Landed · 2026-11-14T20:51Z

    reading value
    PR #33309 MERGED as 9ba2d4cb on main (closes this card via Fixes #33231)

    State: pm:dispatched removed, assignee cleared; card closed by the merge. Behaviour change named in the ACCEPT: an app with no i18n block serves locale.default: en, so its users with no personal language now see English.

  8. removed
    pm:dispatched
    on Nov 14, 2026
  9. added a commit that references this issue on Nov 16, 2026
    9ba2d4c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uipriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions