Skip to content

Dates are half-localized on a zh-CN session — past-relative forms translate, future-relative forms and absolute timestamps stay en-US, on the same row #4468

Description

@baozhoutao

Symptom

On a zh-CN session, the date formatter localizes only some of its branches. Both forms appear on the same rendered rows:

Localized: 逾期 6 天 · 创建于 1天前 · 刚刚 · 3分钟前 · 13分钟前 · 47秒钟前
Not localized: In 2 days · In 3 days · In 5 days · 6 days ago — and absolute timestamps render en-US: 8/11/2026 12:00 am, 8/4/2026 12:00 am

So a single task row can show 逾期 6 天 in one column and In 3 days in the next.

This is not a missing translation and not a raw key: the surrounding chrome and every field label on those pages are fully Chinese (标题/项目/负责人/状态/优先级/截止日期/进度), and a regex scan for raw dotted translation keys across 20+ captured surfaces returned zero hits.

Reproduction

  1. Boot the showcase: node packages/cli/bin/run.js dev -a dist/objectstack.json --seed-admin -d file:/tmp/x.db -p <port>
  2. Open http://localhost:<port>/_console/, sign in as admin@objectos.ai / admin123 (use localhost, not 127.0.0.1).
  3. Set localStorage['objectui-locale'] = 'zh' and reload. Note: language-only 'zh''zh-CN' is rejected by isKnownLanguage().
  4. Open /_console/apps/com.example.showcase/showcase_task and /_console/apps/com.example.showcase/page/showcase_task_all_views.

Expected every relative and absolute date renders in zh-CN.
Actual the past-relative branch localizes; the future-relative branch and Intl.DateTimeFormat output do not.

Reproduced in three independent browser sessions in one run, and previously observed on objectstack-ai/objectstack#7640.

Suspected cause

The formatter appears to thread the active locale into the past-relative branch only, leaving the future-relative branch and the absolute Intl.DateTimeFormat calls on the default locale. 6 days ago also appearing untranslated on the start_date/end_date columns suggests more than one call site rather than a single missing argument.

Source

Found by the platform checklist retest of i18n.studio-follows-app-locale clause 2 (framework 279ee48a, console pin 6314e87f2d49). Recorded in prose on objectstack-ai/objectstack#7640 but never extracted into a card; a search for an existing card found none.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions