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-editor-chrome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
---
'@object-ui/i18n': patch
---

feat(i18n): the rest of the Studio inspectors and the package, form and editor strings move into the `studio` namespace

Clause-②: no
Metadata-protocol: none

- **Third slice of the move ruled on objectstack#25922** (6431032267, Q2 = A; kept by 6431234244). The remaining `engine.inspector.*` keys and every `engine.packages.*`, `engine.form.*` and `engine.edit.*` key (551 in `en`, 560 in `zh`) now live in `@object-ui/i18n/namespaces/studio` instead of `@object-ui/app-shell`'s private table, text unchanged. The nine `engine.packages.form.help.*` rows stay `zh`-only: their English is the producer's own help text, read through `tOptional`. 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 @@ -50,6 +50,11 @@ import userEvent from '@testing-library/user-event';
import type { MetadataAuditEntry, MetadataClient } from '@object-ui/data-objectstack';
import { AuditPanel } from './AuditPanel';
import { t } from './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');

/** The positive claim this card exists to keep off a failed read. */
const EMPTY_TITLE = t('engine.edit.auditEmptyTitle', 'en-US');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ import { WIDGETS } from './widgets';
import { t, tFormat } from './i18n';
import { getIcon } from '../../utils/getIcon';
import { ActionDefaultInspector } from './inspectors/ActionDefaultInspector';
// 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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { render, screen } from '@testing-library/react';
import { ManifestSchema } from '@objectstack/spec/kernel';
import { PackageFormDialog } from './PackageFormDialog';
// 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');

let localeFixture: 'en-US' | 'zh-CN' = 'zh-CN';
vi.mock('./i18n', async (importOriginal) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ import { cleanup, fireEvent, render, screen, waitFor } from '@testing-library/re
import { ManifestSchema } from '@objectstack/spec/kernel';
import { PackageFormDialog } from './PackageFormDialog';
import { t } from './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');

let localeFixture: 'en-US' | 'zh-CN' = 'en-US';
vi.mock('./i18n', async (importOriginal) => ({
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { render, screen, fireEvent, waitFor } from '@testing-library/react';
import { PackageFormDialog } from './PackageFormDialog';
import { t } from './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');

// Which console language the dialog renders in. Only `useMetadataLocale` is
// replaced — the rest of `./i18n` (the `t` resolver and both string tables) is
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ import { resolveHref } from '@object-ui/layout';
import { PackagesPage, type InstalledPackageRow } from './PackagesPage';
import { t } from './i18n';
import { initRuntimeConfig, resetRuntimeConfigForTesting } from '../../runtime-config';
// 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');

const CODE: InstalledPackageRow = {
manifest: { id: 'com.acme.code', name: 'Code App', version: '1.0.0', scope: 'project' },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ vi.mock('./useMetadata', async (importOriginal) => {
});

import { MetadataResourceEditPage, viewRefCatalog } from './ResourceEditPage';
// 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');

function mountEditor() {
render(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ vi.mock('./useMetadata', async (importOriginal) => {
});

import { MetadataResourceEditPage } from './ResourceEditPage';
// 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');

const START_PATH = '/metadata/object/showcase_account';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,11 @@ vi.mock('./useMetadata', async (importOriginal) => {
});

import { MetadataResourceEditPage } from './ResourceEditPage';
// 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');

const START_PATH = '/metadata/object/showcase_account';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ import { I18nProvider } from '@object-ui/i18n';
import { SchemaForm } from './SchemaForm';
import { t } from './i18n';
import { localizeMetadataForm } from './metadata-form-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);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@
*/
import { describe, it, expect } from 'vitest';
import { t } from './i18n';
// `engine.edit.*` 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');

describe('artifactLockedBanner wording — F6', () => {
it('[en] is accurate (not "shipped by a code package") and states the edit path', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ vi.mock('../useMetadata.js', () => ({

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);

Expand Down
Loading
Loading