Skip to Content

LocalizationEditor

Switch between explicitly configured locales and edit each locale's independent field values.

LocalizationEditor provides locale tabs and missing/translated indicators. Values are supplied per locale; it does not invent fallback content or copy fields between translations.

On localization-enabled collections, the Fullstack CMS client exposes listLocaleVariants(entryId, queryWithoutLocale?) and createTranslation(entryId, data, { locale, slug?, changeSummary? }). Project returned documents into the component's per-locale values map; the component does not fetch or persist translations.

390 × 844

API

PropTypeRequiredDefault
contentTypeCmsCollectionPresentationYes—
valuesReadonly<Record<string, CmsFields | null | undefined>>Yes—
onChange(locale: string, fields: CmsFields) => voidYes—
onInvalidDraftChange(invalid: boolean) => voidNo—
activeLocalestringNoDefault locale or first locale
onActiveLocaleChange(locale: string) => voidNoInternal state
renderLocale(locale, fields, onChange) => ReactNodeNoJSON fields editor
disabledbooleanNofalse
import { LocalizationEditor } from "@puzzle-ui/pieces";

<LocalizationEditor
  contentType={contentType}
  values={entryFieldsByLocale}
  onChange={(locale, fields) => updateTranslation(locale, fields)}
/>;

The selected locale can be controlled or internal. Tabs expose selected state and linked tab panels. Keep locale authorization, fallback policy, translation completeness rules, and persistence in the caller and CMS service.

The built-in editor requires a JSON object and reports invalid local drafts via onInvalidDraftChange. Other locale tabs are disabled until the draft is corrected; a host controlling activeLocale must also avoid changing it while invalid. Use the same state to guard save and navigation actions. Custom renderLocale controls must handle their own invalid state.

API maturity

API maturity: Stable.