Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .changeset/25922-studio-i18n-pillars-datasources.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/i18n': patch
---

feat(i18n): five Studio pillars, the data source pages and the field types move into the `studio` namespace

Clause-②: no
Metadata-protocol: none

- **Fourth slice of the move ruled on objectstack#25922** (6431032267, Q2 = A; kept by 6431234244). The keys under `engine.studio.access.*`, `engine.studio.if.*`, `engine.studio.data.*`, `engine.studio.auto.*` and `engine.studio.settings.*`, the data source pages' `engine.datasource.*`, `engine.externalDatasource.*` and `engine.datasourcePreview.*`, and the field types' `engine.fieldType.*`, `engine.fieldTypeDesc.*` and `engine.fieldCategory.*` (549 keys in both `en` and `zh`) now live in `@object-ui/i18n/namespaces/studio` instead of `@object-ui/app-shell`'s private table, text unchanged. Studio reads the same strings; a Chinese viewer sees these labels in English for the moment the `zh` catalogue takes to load, as with the earlier slices. No export changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ vi.mock('sonner', () => ({ toast: { success: vi.fn(), error: vi.fn() } }));
import { t } from '../i18n';
import { DatasourceResourcePage } from './DatasourceResourcePage';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(cleanup);

const DRIVER = { id: 'sqlite', label: 'SQLite', configSchema: { properties: {} } };
Expand Down
1,247 changes: 0 additions & 1,247 deletions ui/packages/app-shell/src/views/metadata-admin/i18n.ts

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.

/**
* objectstack#25922 slices S2 and S3 — the designer rows that moved into
* `@object-ui/i18n`'s `studio` namespace (every `engine.inspector.*` row, and
* `engine.packages.*`, `engine.form.*`, `engine.edit.*`), and app-shell's `t()`
* / `tOptional()` still answer every one of them the way they did when the rows
* objectstack#25922 slices S2 to S4 — the designer rows that moved into
* `@object-ui/i18n`'s `studio` namespace (every `engine.inspector.*` row;
* `engine.packages.*`, `engine.form.*`, `engine.edit.*`; five `engine.studio.*`
* pillars, the data source pages and the field types), and app-shell's `t()` /
* `tOptional()` still answer every one of them the way they did when the rows
* sat in its own table.
*
* What would break it:
Expand Down Expand Up @@ -41,6 +42,18 @@ const FAMILY_FLOOR: Readonly<Record<string, number>> = Object.freeze({
'engine.packages.': 120,
'engine.form.': 90,
'engine.edit.': 90,
// S4 — five Studio pillars, the data source pages, the field types
'engine.studio.access.': 120,
'engine.studio.if.': 50,
'engine.studio.data.': 45,
'engine.studio.auto.': 40,
'engine.studio.settings.': 35,
'engine.datasource.': 50,
'engine.externalDatasource.': 45,
'engine.datasourcePreview.': 10,
'engine.fieldType.': 45,
'engine.fieldTypeDesc.': 45,
'engine.fieldCategory.': 9,
});

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,12 @@ describe('a retired key leaves BOTH locale tables (objectui#8368)', () => {
// FEWER keys — which would make every assertion below vacuously green over
// an empty corpus. Ranges first: overlapping ones would mean the `};`
// scan ran past a table and both sets became the same set.
// The table drains slice by slice into the namespace (objectstack#25922),
// so its floor is "non-empty"; the 3,000-key floor is held over both homes
// together, below.
expect(EN_TABLE.to).toBeLessThan(ZH_TABLE.from);
expect(EN_TABLE.keys.length).toBeGreaterThan(1500);
expect(ZH_TABLE.keys.length).toBeGreaterThan(1500);
expect(EN_TABLE.keys.length).toBeGreaterThan(0);
expect(ZH_TABLE.keys.length).toBeGreaterThan(0);
// No duplicates: a key declared twice would be a silent overwrite, and the
// set arithmetic below would hide it.
expect(EN_TABLE.keys.length).toBe(new Set(EN_TABLE.keys).size);
Expand All @@ -691,6 +694,8 @@ describe('a retired key leaves BOTH locale tables (objectui#8368)', () => {
expect(ZH_HOME.keys.length).toBeGreaterThan(150);
expect(EN_KEYS.keys.length).toBe(new Set(EN_KEYS.keys).size);
expect(ZH_KEYS.keys.length).toBe(new Set(ZH_KEYS.keys).size);
expect(EN_KEYS.keys.length).toBeGreaterThan(3000);
expect(ZH_KEYS.keys.length).toBeGreaterThan(3000);
});

it('the extractor really sees the keys the derivation implies', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,12 @@ import { PermissionPreview } from './PermissionPreview';
import { PositionPreview } from './PositionPreview';
import { TranslationPreview } from './TranslationPreview';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(cleanup);

type Lang = 'en' | 'zh';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ vi.mock('../external/api', async (importOriginal) => {
import { t, tFormat } from '../i18n';
import { DatasourcePreview } from './DatasourcePreview';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(() => {
cleanup();
state.refresh = 'ok';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ vi.mock('../external/api', async (importOriginal) => {
import { t, tFormat } from '../i18n';
import { DatasourcePreview } from './DatasourcePreview';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(() => {
cleanup();
state.tables = [];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,13 @@
import { describe, expect, it } from 'vitest';
import { t } from './i18n';

// `engine.studio.auto.*` lives in `@object-ui/i18n`'s `studio` namespace, whose
// `zh` catalogue is fetched on demand (objectstack#25922). Resident before any
// case: this file runs in the `unit` project, whose shared module graph would
// otherwise let it pass only when another file had loaded `zh` first.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

/** The automation pillar's chrome: every `engine.studio.auto.*` row it renders as prose. */
const PILLAR_ROWS = [
'engine.studio.auto.heading',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*
* The Data pillar's "Add field" popover mixes both homes on one screen: its
* field labels (`designer.field.label` / `.apiName` / `.type`) moved into the
* namespace, its title and buttons (`engine.studio.*`) are still in the
* app-shell table. It takes its locale from `useMetadataLocale()`, the hook
* namespace, its Cancel button (`engine.studio.cancel`) is still in the
* app-shell table (its title and Create button followed in slice S4). It takes its locale from `useMetadataLocale()`, the hook
* every designer component uses, so this is the path a real screen takes:
*
* - zh: the namespace's `zh` catalogue is NOT resident when the screen first
Expand Down Expand Up @@ -40,7 +40,7 @@ afterEach(cleanup);
/** Keys this screen renders from the namespace. */
const MOVED = ['designer.field.label', 'designer.field.type'] as const;
/** A key this screen renders from the app-shell table. */
const TABLE = 'engine.studio.data.addField';
const TABLE = 'engine.studio.cancel';

function Screen({ lang }: { lang: string }) {
return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ import { FIELD_TYPE_META, type FieldTypeId } from '../metadata-admin/previews/fi
import { fieldTypeName } from '../metadata-admin/previews/fieldTypeName';
import { t, tFormat } from '../metadata-admin/i18n';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(cleanup);

type Lang = 'en' | 'zh';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,12 @@ vi.mock('@object-ui/react', async (importOriginal) => {
import { DataPillar } from './StudioDesignSurface';
import { t } from '../metadata-admin/i18n';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

afterEach(cleanup);

function renderPillar(props: Partial<React.ComponentProps<typeof DataPillar>> = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ import { InterfacesPillar, StudioNavItemInspector } from './StudioDesignSurface'
import { t } from '../metadata-admin/i18n';
import { listStudioCanvasPreviewTypes } from './studio-canvas-preview';

// The designer rows this suite reads in zh live in `@object-ui/i18n`'s `studio`
// namespace, whose `zh` catalogue is fetched on demand (objectstack#25922).
// Resident before any case, so the zh rows below read synchronously.
import { loadStudioCatalogue } from '@object-ui/i18n/namespaces/studio';
await loadStudioCatalogue('zh');

// ── StudioDesignSurface.railLabelInherits-11196 ──────────────────────────────

/**
Expand Down
Loading
Loading