Skip to content
Draft
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
97 changes: 97 additions & 0 deletions .changeset/37223-i18n-removed-released-keys.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
---
'@object-ui/i18n': major
---

feat(i18n)!: the 67 translation keys `@object-ui/i18n@18.6.0` shipped that no code reads any more are retired in 19.0.0

**BREAKING**: released keys are retired in 19.0.0. `@object-ui/i18n@18.6.0` shipped every key listed below; none of them is in the package any more, in any locale. No code in the platform reads them.

Clause-②: yes (narrowing)
Metadata-protocol: none

<!-- adr-0087: not-required (no-migration-prescription) The retired operands are translation keys in the published i18n catalogues: no packages/spec schema, registered node type, stored metadata row or ADR-0087 conversion surface names them, and nothing a metadata author writes changes, so there is nothing for objectstack migrate meta to rewrite -->

If a deployment overrides one of these keys (in its own i18next resources, or a Studio catalogue it registers), that override no longer applies: nothing in the console or Studio asks for the key, so the overriding text is never shown. Remove the override, or move the text to the key the surface reads now.

`@object-ui/i18n` is in the changesets `fixed` group, so this `major` moves every package in that group to 19, every `@objectstack/*` package included. The line's opening marker is a second `major` (on `@objectstack/spec`) in the same group; two majors in one fixed group still give one 19.0.0. In pre mode under `next` the first version step reads `19.0.0-next.0`.

The list is reproduced by `node ui/packages/i18n/scripts/released-keys-removed.mjs` (the tag against `origin/main`, every locale and namespace the package publishes, nested keys flattened).

## Removed translation keys

### Language packs (`@object-ui/i18n`, `@object-ui/i18n/locales`), 32 keys

Each key below is removed from all eleven locales: ar, de, en, es, fr, ja, ko, pt-BR, ru, zh-Hans, zh-Hant.

- `appDesigner.fieldDesigner.trackHistory`
- `console.firstRunChecklist.confirm`
- `console.firstRunChecklist.currency.saved`
- `console.firstRunChecklist.currency.title`
- `console.firstRunChecklist.currency.todo`
- `console.firstRunChecklist.languageCountry.saved`
- `console.firstRunChecklist.languageCountry.title`
- `console.firstRunChecklist.languageCountry.todo`
- `console.firstRunChecklist.organizationName.action`
- `console.firstRunChecklist.organizationName.title`
- `console.firstRunChecklist.organizationName.todo`
- `console.firstRunChecklist.prefilled`
- `console.firstRunChecklist.timezone.saved`
- `console.firstRunChecklist.timezone.title`
- `console.firstRunChecklist.timezone.todo`
- `console.nav.design`
- `console.nav.phoneBarHint`
- `console.nav.searchMenu`
- `console.objectView.openAsPage`
- `console.objectView.personalizedParts.rowNumbers`
- `dashboard.exportCsv`
- `detail.collapseToDrawer`
- `filterBuilder.where`
- `list.recordOpen`
- `list.recordOpenDeclaredPage`
- `list.recordOpenDrawer`
- `list.recordOpenNote`
- `list.recordOpenPage`
- `list.rowNumbers`
- `sidebar.keepOpen`
- `view.switcher.all`
- `view.switcher.saveAsMyView`

### Studio namespace (`@object-ui/i18n/namespaces/studio`), 35 keys

Each key below is removed from both locales the namespace ships: en, zh.

- `designer.field.relatedList.parentFallback`
- `designer.field.trackHistory`
- `engine.edit.autoSaveOff`
- `engine.edit.autoSaveOn`
- `engine.edit.autoSavingShortly`
- `engine.edit.related`
- `engine.packages.installedApps.description`
- `engine.packages.installedApps.title`
- `engine.studio.autoSaved`
- `engine.studio.data.form.flowCreate`
- `engine.studio.data.form.flowEdit`
- `engine.studio.data.form.flowLabel`
- `engine.studio.data.form.layoutSource.fieldGroups`
- `engine.studio.data.form.layoutSource.fieldGroupsTitle`
- `engine.studio.data.form.layoutSource.formView`
- `engine.studio.data.form.layoutSource.formViewTitle`
- `engine.studio.designer.offForm`
- `engine.studio.designer.sectionDeleteTitle`
- `engine.studio.flowSavedNamed`
- `engine.studio.flowSaveFailed`
- `engine.studio.inspector.listView.kanbanCard.mode.drawer`
- `engine.studio.inspector.listView.kanbanCard.mode.newWindow`
- `engine.studio.inspector.listView.kanbanCard.mode.page`
- `engine.studio.openApp`
- `engine.studio.openAppPick`
- `engine.studio.openAppTitle`
- `engine.studio.owd.save`
- `engine.studio.owd.saved`
- `engine.studio.owd.saveNone`
- `engine.studio.pillar.access`
- `engine.studio.pillar.automations`
- `engine.studio.pillar.data`
- `engine.studio.pillar.interfaces`
- `engine.studio.pillar.metadata`
- `engine.studio.settings.highlightPreview`
14 changes: 14 additions & 0 deletions .changeset/37223-v19-line-opens.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
---
"@objectstack/spec": major
---

The v19 line opens (maintainer rulings 7153326968 and 7153441862). Every release from here is a `19.0.0-next.N` prerelease on the npm dist-tag `next`, until 19.0 GA.

Clause-②: no

- **What this marks.** Changesets is in pre mode with the tag `next`. Every package in the `fixed` group versions together, so this `major` takes all of them to 19, and the first version cut is `19.0.0-next.0`. `PROTOCOL_VERSION` follows `@objectstack/spec`'s major at version time. The marker itself changes no code, key, export or stored shape.
- **What the line carries.** Each breaking change on the line says so in its own changeset. The first is `@object-ui/i18n`'s retirement of the translation keys 18.6.0 shipped and no code reads any more; a second `major` in the same `fixed` group still gives one 19.0.0.
- **Who receives it.** A plain install still resolves the dist-tag `latest`, which stays on 18.x until 19.0 GA. A prerelease is installed only on request: `@objectstack/spec@next`, or an exact `19.0.0-next.N`.
- **What ends it.** 19.0 GA exits pre mode and publishes to `latest`.

<!-- adr-0087: not-required (no-migration-prescription) the v19 line's opening marker: Changesets pre mode plus one major on the fixed group, so the train versions 19.0.0-next.N. No authorable key, spelling, export, type or stored shape moves in this changeset, and no stored row is read, rewritten or converted; each breaking change of the line states its own disposition in its own changeset. The other categories are closed on facts: the package publishes (not unpublished); no ADR-0087 id is named or touched (not registered or already-registered); and no TypeScript declaration moves (not runtime-interface-only or type-surface-only). -->
4 changes: 4 additions & 0 deletions .changeset/pre.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"mode": "pre",
"tag": "next"
}
253 changes: 253 additions & 0 deletions ui/packages/i18n/scripts/released-keys-removed.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,253 @@
#!/usr/bin/env node
// Copyright (c) 2026 ObjectStack. Licensed under the Apache-2.0 license.
/**
* released-keys-removed.mjs — every translation key a released `@object-ui/i18n`
* shipped that a later tree no longer carries.
*
* Usage (from anywhere inside the repository):
*
* node ui/packages/i18n/scripts/released-keys-removed.mjs \
* [--tag @object-ui/i18n@18.6.0] [--ref origin/main] [--json]
*
* It reads the package's catalogue sources out of git at BOTH refs (never the
* working tree), so it answers the same on any checkout. Zero third-party
* dependencies: git for the blobs, Node's own type stripping to evaluate the
* catalogue modules (they import nothing, so each one evaluates alone).
*
* ## Which files are the published catalogues — read from the package, not listed here
*
* - `package.json` `exports`: every `./namespaces/NAME` subpath is a published
* namespace; `./locales` is the all-packs door.
* - `src/locales/index.ts` (the all-packs door): each DEFAULT import of a
* `./TAG.js` module is a language pack, and each default import of a
* `../namespaces/NAME/TAG.js` module is that language's catalogue in a
* pack-shaped namespace. The door deep-merges them into one catalogue per
* language, and at runtime they all land in i18next's default
* `translation` namespace, so they are ONE key space: a key that moved
* from a pack into a pack-shaped namespace (or back) is not removed.
* - Every other exported namespace (one whose `index.ts` does not build on
* `../packNamespace.js`, today `studio`) is a key space of its own; its
* catalogues are the `./TAG.js` modules its `index.ts` imports, statically
* or through a literal `import()` loader.
*
* A key is the dotted path to a leaf value (strings, plus any non-object
* value, arrays included), so plural forms (`KEY_one`, `KEY_other`, …) are
* separate keys. A key counts as removed in a language when that language's
* catalogue at the tag has it and the same key space at the ref does not.
*/
import { execFileSync } from 'node:child_process';
import { mkdtempSync, mkdirSync, writeFileSync, rmSync } from 'node:fs';
import { tmpdir } from 'node:os';
import { dirname, join, posix } from 'node:path';
import { fileURLToPath, pathToFileURL } from 'node:url';

const args = process.argv.slice(2);
const opt = (name, fallback) => {
const i = args.indexOf(name);
if (i === -1) return fallback;
const v = args[i + 1];
if (!v || v.startsWith('--')) {
console.error(`released-keys-removed: ${name} needs a value`);
process.exit(2);
}
return v;
};
const TAG = opt('--tag', '@object-ui/i18n@18.6.0');
const REF = opt('--ref', 'origin/main');
const AS_JSON = args.includes('--json');

// git runs in the package directory and every blob is named in git's own
// cwd-relative form (`REF:./PATH`), so the script needs no repository root and
// reads the same in the standalone and the monorepo layout.
const PKG_DIR = dirname(dirname(fileURLToPath(import.meta.url)));
const git = (...a) => execFileSync('git', a, { cwd: PKG_DIR, encoding: 'utf8', maxBuffer: 1 << 28 });
const PKG = git('rev-parse', '--show-prefix').trim().replace(/\/$/, ''); // for messages only

const show = (ref, path) => git('show', `${ref}:./${path}`);
const exists = (ref, path) => {
try {
git('cat-file', '-e', `${ref}:./${path}`);
return true;
} catch {
return false;
}
};

for (const ref of [TAG, REF]) {
try {
git('rev-parse', '--verify', '--quiet', `${ref}^{commit}`);
} catch {
console.error(`released-keys-removed: ref '${ref}' does not resolve (fetch it first)`);
process.exit(2);
}
}

const tmp = mkdtempSync(join(tmpdir(), 'released-keys-removed-'));
process.on('exit', () => rmSync(tmp, { recursive: true, force: true }));
let seq = 0;

/** Evaluate one catalogue module's default export from its source at `ref`. */
async function loadCatalogue(ref, path) {
const dir = join(tmp, String(seq++));
mkdirSync(dir);
const file = join(dir, posix.basename(path));
writeFileSync(file, show(ref, path));
const mod = await import(pathToFileURL(file).href);
if (!mod.default || typeof mod.default !== 'object') {
throw new Error(`${ref}:${PKG}/${path} has no object default export`);
}
return mod.default;
}

const isPlain = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
function flatten(obj, prefix = '', out = new Set()) {
for (const [k, v] of Object.entries(obj)) {
const key = prefix ? `${prefix}.${k}` : k;
if (isPlain(v)) flatten(v, key, out);
else out.add(key);
}
return out;
}

/** `./x.js` / `../a/b.js` specifiers of default imports and literal `import()` calls. */
function defaultImports(src) {
return [...src.matchAll(/^\s*import\s+[A-Za-z_$][\w$]*\s+from\s+'([^']+)'/gm)].map((m) => m[1]);
}
function dynamicImports(src) {
return [...src.matchAll(/import\(\s*'([^']+)'\s*\)/g)].map((m) => m[1]);
}
const tagOf = (spec) => posix.basename(spec).replace(/\.js$/, '');
const toSrc = (fromDir, spec) => posix.normalize(posix.join(fromDir, spec)).replace(/\.js$/, '.ts');

/**
* The catalogues one ref publishes:
* Map<space, Map<lang, Array<{ module, path }>>>, where `module` names the
* published group the file belongs to (`locales`, or the namespace name).
*/
function discover(ref) {
const pkg = JSON.parse(show(ref, 'package.json'));
const exp = Object.keys(pkg.exports ?? {});
if (!exp.includes('./locales')) throw new Error(`${ref}: package.json exports no ./locales`);
const namespaces = exp
.filter((k) => k.startsWith('./namespaces/'))
.map((k) => k.slice('./namespaces/'.length));

const spaces = new Map();
const add = (space, lang, module, path) => {
if (!spaces.has(space)) spaces.set(space, new Map());
const langs = spaces.get(space);
if (!langs.has(lang)) langs.set(lang, []);
langs.get(lang).push({ module, path });
};

// The all-packs door: packs + pack-shaped namespaces, one `translation` space.
const door = show(ref, 'src/locales/index.ts');
const packShaped = new Set();
for (const spec of defaultImports(door)) {
if (!spec.startsWith('.')) continue;
const path = toSrc('src/locales', spec);
const m = /^src\/namespaces\/([^/]+)\/[^/]+\.ts$/.exec(path);
if (m) {
packShaped.add(m[1]);
add('translation', tagOf(spec), m[1], path);
} else if (/^src\/locales\/[^/]+\.ts$/.test(path)) {
add('translation', tagOf(spec), 'locales', path);
}
}

// Every exported namespace's own catalogue modules.
for (const ns of namespaces) {
const index = `src/namespaces/${ns}/index.ts`;
if (!exists(ref, index)) throw new Error(`${ref}: export ./namespaces/${ns} has no ${index}`);
const src = show(ref, index);
const isPackShaped = /from '\.\.\/packNamespace\.js'/.test(src);
const specs = [...defaultImports(src), ...dynamicImports(src)].filter((s) => /^\.\/[^/]+\.js$/.test(s));
for (const spec of new Set(specs)) {
const path = toSrc(`src/namespaces/${ns}`, spec);
if (isPackShaped) {
// Already in the door; a catalogue the door does not merge would be a
// published file outside every key space this script knows: refuse.
const listed = spaces.get('translation')?.get(tagOf(spec))?.some((e) => e.path === path);
if (!listed) throw new Error(`${ref}: ${path} is loaded by ${index} but not merged by src/locales/index.ts`);
} else {
add(ns, tagOf(spec), ns, path);
}
}
}
return spaces;
}

/** Map<space, Map<lang, Map<key, module>>> for one ref. */
async function keysAt(ref) {
const out = new Map();
for (const [space, langs] of discover(ref)) {
const perLang = new Map();
for (const [lang, entries] of langs) {
const keys = new Map();
for (const { module, path } of entries) {
for (const k of flatten(await loadCatalogue(ref, path))) keys.set(k, module);
}
perLang.set(lang, keys);
}
out.set(space, perLang);
}
return out;
}

const before = await keysAt(TAG);
const after = await keysAt(REF);

// removed: Map<groupName, Map<key, Set<lang>>>; group = space, or the module a
// `translation` key lived in at the tag.
const removed = new Map();
let moved = 0;
for (const [space, langs] of before) {
for (const [lang, keys] of langs) {
const now = after.get(space)?.get(lang) ?? new Map();
for (const [key, module] of keys) {
if (now.has(key)) {
if (now.get(key) !== module) moved++;
continue;
}
const group = space === 'translation' ? module : space;
if (!removed.has(group)) removed.set(group, new Map());
const g = removed.get(group);
if (!g.has(key)) g.set(key, new Set());
g.get(key).add(lang);
}
}
}

const tagLangs = (space) => [...(before.get(space)?.keys() ?? [])];
const total = [...removed.values()].reduce((n, g) => n + g.size, 0);
const groups = [...removed.keys()].sort();

if (AS_JSON) {
const body = {
tag: TAG,
ref: REF,
refSha: git('rev-parse', REF).trim(),
total,
movedBetweenModules: moved,
groups: Object.fromEntries(
groups.map((g) => [
g,
Object.fromEntries([...removed.get(g)].sort(([a], [b]) => a.localeCompare(b)).map(([k, l]) => [k, [...l].sort()])),
]),
),
};
console.log(JSON.stringify(body, null, 2));
} else {
console.log(`Keys in ${TAG} absent at ${REF} (${git('rev-parse', '--short', REF).trim()}): ${total}`);
for (const g of groups) {
const space = before.has(g) ? g : 'translation';
const all = tagLangs(space);
console.log(`\n## ${g} (${removed.get(g).size})`);
for (const [key, langs] of [...removed.get(g)].sort(([a], [b]) => a.localeCompare(b))) {
const l = [...langs].sort();
const which = l.length === all.length ? `all ${all.length} locales (${l.join(', ')})` : l.join(', ');
console.log(`- ${key} — ${which}`);
}
}
if (moved) console.log(`\n(${moved} key×locale rows moved between modules inside one key space; not removals)`);
}
Loading