ObjectStackObjectStack

Translation

Translation protocol schemas

Source: packages/spec/src/system/translation.zod.ts

TypeScript Usage

import { ActionResultDialogTranslationSchema, CoverageBreakdownEntrySchema, FieldTranslationSchema, LocaleSchema, ObjectTranslationDataSchema, TranslationBundleSchema, TranslationConfigSchema, TranslationCoverageResultSchema, TranslationDataSchema, TranslationDiffItemSchema, TranslationDiffStatusSchema, TranslationItemSchema } from '@objectstack/spec/system';
import type { ActionResultDialogTranslation, CoverageBreakdownEntry, FieldTranslation, Locale, ObjectTranslationData, TranslationBundle, TranslationConfig, TranslationCoverageResult, TranslationData, TranslationDiffItem, TranslationDiffStatus, TranslationItem } from '@objectstack/spec/system';

// Validate data
const result = ActionResultDialogTranslationSchema.parse(data);

ActionResultDialogTranslation

Translations for an action result dialog

Properties

PropertyTypeRequiredDescription
titlestringoptionalTranslated result dialog title
descriptionstringoptionalTranslated result dialog description
acknowledgestringoptionalTranslated acknowledge button label
fieldsRecord<string, string>optionalResult field labels keyed by the literal field path declared in the action metadata (keys may contain dots)

CoverageBreakdownEntry

Coverage breakdown for a single translation group

Properties

PropertyTypeRequiredDescription
groupstringTranslation group category
totalKeysintegerTotal keys in this group
translatedKeysintegerTranslated keys in this group
coveragePercentnumberCoverage percentage for this group

FieldTranslation

Translation data for a single field

Properties

PropertyTypeRequiredDescription
labelstringoptionalTranslated field label
helpstringoptionalTranslated help text
placeholderstringoptionalTranslated placeholder text for form inputs
optionsRecord<string, string>optionalOption value to translated label map

Locale

BCP-47 Language Tag (e.g. en-US, zh-CN)

Type: string


ObjectTranslationData

Translation data for a single object

Properties

PropertyTypeRequiredDescription
labelstringoptionalTranslated singular label
pluralLabelstringoptionalTranslated plural label
descriptionstringoptionalTranslated object description
fieldsRecord<string, { label?: string; help?: string; placeholder?: string; options?: Record<string, string> }>optionalField-level translations
_viewsRecord<string, { label?: string; description?: string; emptyState?: object }>optionalView translations keyed by view name
_actionsRecord<string, { label?: string; description?: string; confirmText?: string; successMessage?: string; … }>optionalAction translations keyed by action name
_sectionsRecord<string, { label?: string; description?: string }>optionalSection translations keyed by section name
_tabsRecord<string, { label?: string }>optionalFilter-preset tab translations keyed by tab name

TranslationBundle

Map of locale codes to translation data

Type: Record<string, { objects?: Record<string, object>; apps?: Record<string, object>; messages?: Record<string, string>; globalActions?: Record<string, object>; … }>


TranslationConfig

Internationalization configuration

Properties

PropertyTypeRequiredDescription
defaultLocalestringDefault locale (e.g., "en")
supportedLocalesstring[]Supported BCP-47 locale codes
fallbackLocalestringoptionalFallback locale code

TranslationCoverageResult

Aggregated translation coverage result

Properties

PropertyTypeRequiredDescription
localestringBCP-47 locale code
objectNamestringoptionalObject name scope (omit for full bundle)
totalKeysintegerTotal translatable keys from metadata
translatedKeysintegerNumber of translated keys
missingKeysintegerNumber of missing translations
redundantKeysintegerNumber of redundant translations
staleKeysintegerNumber of stale translations
coveragePercentnumberTranslation coverage percentage
items{ key: string; status: Enum<'missing' | 'redundant' | 'stale'>; objectName?: string; locale: string; … }[]Detailed diff items
breakdown{ group: string; totalKeys: integer; translatedKeys: integer; coveragePercent: number }[]optionalPer-group coverage breakdown

TranslationData

Translation data for objects, apps, and UI messages

Properties

PropertyTypeRequiredDescription
objectsRecord<string, { label?: string; pluralLabel?: string; description?: string; fields?: Record<string, object>; … }>optionalObject translations keyed by object name
appsRecord<string, { label: string; description?: string; navigation?: Record<string, object> }>optionalApp translations keyed by app name
messagesRecord<string, string>optionalUI message translations keyed by message ID
globalActionsRecord<string, { label?: string; description?: string; confirmText?: string; successMessage?: string; … }>optionalGlobal action translations keyed by action name
dashboardsRecord<string, { label?: string; description?: string; actions?: Record<string, object>; widgets?: Record<string, object> }>optionalDashboard translations keyed by dashboard name
pagesRecord<string, { label?: string; description?: string; title?: string; subtitle?: string; … }>optionalPage translations keyed by page name
flowsRecord<string, { label?: string; screens?: Record<string, object> }>optionalScreen-flow translations keyed by flow name
settingsRecord<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>optionalSettings manifest translations keyed by namespace
metadataFormsRecord<string, { label?: string; description?: string; sections?: Record<string, object>; fields?: Record<string, object> }>optionalTranslations for metadata-type configuration forms keyed by metadata type
settingsCommon{ sourceLabels?: object }optionalCross-namespace Settings UI strings

TranslationDiffItem

A single translation diff item

Properties

PropertyTypeRequiredDescription
keystringDot-path translation key
statusEnum<'missing' | 'redundant' | 'stale'>Diff status of this translation key
objectNamestringoptionalAssociated object name (snake_case)
localestringBCP-47 locale code
sourceHashstringoptionalHash of source metadata for precise stale detection
aiSuggestedstringoptionalAI-suggested translation for this key
aiConfidencenumberoptionalAI suggestion confidence score (0–1)

TranslationDiffStatus

Translation diff status: missing from bundle, redundant (no matching metadata), or stale (metadata changed)

Allowed Values

  • missing
  • redundant
  • stale

TranslationItem

One locale of translations — the translation metadata type

Properties

PropertyTypeRequiredDescription
objectsRecord<string, { label?: string; pluralLabel?: string; description?: string; fields?: Record<string, object>; … }>optionalObject translations keyed by object name
appsRecord<string, { label: string; description?: string; navigation?: Record<string, object> }>optionalApp translations keyed by app name
messagesRecord<string, string>optionalUI message translations keyed by message ID
globalActionsRecord<string, { label?: string; description?: string; confirmText?: string; successMessage?: string; … }>optionalGlobal action translations keyed by action name
dashboardsRecord<string, { label?: string; description?: string; actions?: Record<string, object>; widgets?: Record<string, object> }>optionalDashboard translations keyed by dashboard name
pagesRecord<string, { label?: string; description?: string; title?: string; subtitle?: string; … }>optionalPage translations keyed by page name
flowsRecord<string, { label?: string; screens?: Record<string, object> }>optionalScreen-flow translations keyed by flow name
settingsRecord<string, { title?: string; description?: string; groups?: Record<string, object>; keys?: Record<string, object>; … }>optionalSettings manifest translations keyed by namespace
metadataFormsRecord<string, { label?: string; description?: string; sections?: Record<string, object>; fields?: Record<string, object> }>optionalTranslations for metadata-type configuration forms keyed by metadata type
settingsCommon{ sourceLabels?: object }optionalCross-namespace Settings UI strings
localestringBCP-47 locale this item translates (e.g. "zh-CN")
namestringoptionalItem name — conventionally the locale code (zh-CN); the runtime sync falls back to it when locale is absent
labelstringoptionalHuman-readable label shown in metadata lists
_lockEnum<'none' | 'no-overlay' | 'no-delete' | 'full'>optionalItem-level lock — controls overlay & delete (ADR-0010).
_lockReasonstringoptionalHuman-readable reason shown when a write is refused by _lock.
_lockSourceEnum<'artifact' | 'package' | 'env-forced'>optionalLayer that set _lock (artifact | package | env-forced).
_provenanceEnum<'package' | 'org' | 'env-forced'>optionalOrigin of the item (package | org | env-forced).
_packageIdstringoptionalOwning package machine id.
_packageVersionstringoptionalOwning package version.
_lockDocsUrlstringoptionalOptional documentation link surfaced next to _lockReason.

On this page