Skip to content

Analytics: a LOCAL select dimension on a CHART widget still renders English option labels — the cell #4324 and #4330 both left uncovered #7696

Description

@os-warren

Found while retiring the last i18n exemptions in the downstream duly app (objectstack-ai/duly#106), on @objectstack/* 17.3.0. Filing rather than working around it: the app has no knob for this, and the two obvious app-side fixes are both losses (write the option labels in Chinese in the object, which breaks en; or drop the legend).

The gap, as a 2×2

Two cards have closed three of the four cells. The fourth is still open and nothing tracks it:

dotted dimension (client-resolved) local select dimension (server-resolved)
chart (legend / series) fixed by #4030 / PR #4324 this card — still English
table / pivot / report block fixed by #4030 / PR #4324 fixed by #4330 / PR #4388

#4324 localizes the label net "only where the net RESOLVES labels client-side (dotted dimensions, chart paths that load object metadata)" (#4330's own words). #4330/#4388 then took the server-resolved local select path — but scoped to table/pivot and the dataset report block. A chart fed by a local select dimension is server-resolved too, and it was in neither scope.

Measurement

duly_duty_register is a dataset on duly_duty with a local dimension form (a select with three options) and a pie widget with showLegend: true. objects.duly_duty.fields.form.options.* is in the shipped zh-CN bundle, and the list view beside the dashboard renders it correctly (周期性).

POST /api/v1/analytics/dataset/query, same payload, only accept-language varying:

== accept-language: zh-CN
  rows:         ['One-off', 'Recurring', 'Standing']
  field labels: ['形式', '清单内职责']
== accept-language: zh
  rows:         ['One-off', 'Recurring', 'Standing']
  field labels: ['形式', '清单内职责']
== accept-language: en
  rows:         ['One-off', 'Recurring', 'Standing']
  field labels: ['Form', 'Duties on the register']

Two things this pins:

  1. The locale reaches the endpoint and is honouredfields[].label switches with it (those are dataset dimension/measure labels, newly translatable via translateDataset in objectstack#14381). So this is not a missing-locale problem.
  2. rows[].form is byte-identical in all three locales. The option label is baked into the row server-side; drillRawRows keeps the stored values (one_off / recurring / standing) beside it. The console receives the English and has nothing to localize against, exactly the shape Analytics: LOCAL select dimensions on table/pivot (and the dataset report block) still render English option labels — the server-resolved path never meets the localize seam #4330 describes — one surface over.

The rendered legend reads One-off / Recurring / Standing under a title, description and axis labels that are all Chinese.

Suggested landing

The same seam #4388 used (resolveDimensionFieldMetalocalizeFieldOptions), extended to the chart path when the dimension is a local select. #4330's PM ruling already amended the #4263 no-metadata-read boundary deliberately for table/pivot and recorded the reasoning; a chart with a local select dimension is the same read for the same reason, so this looks like widening that amendment rather than opening a new one. Identity keys (colour mapping, category order, drill filters) stay on stored values per the #4263/#4273 conventions.

Refs #4030, #4330, PR #4324, PR #4388, #4263, ADR-0021. Downstream evidence and screenshots: objectstack-ai/duly#106.

Activity

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

    bugSomething isn't workingdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seati18npm:queuepriority:p2

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions