When it applies
Localization features only appear for content types defined withlocalized: true in your schema:
__mdcms_default__ locale behind the scenes. The locale switcher does not appear in the editor for these types.
Locale configuration
Locale support is configured inmdcms.config.ts under the locales key:
| Property | Type | Description |
|---|---|---|
default | string | The default locale used when no locale is specified |
supported | string[] | All locales your project supports |
aliases | Record<string, string> | Maps variant codes to canonical locales (e.g., "en-US" resolves to "en") |
Non-localized types ignore the locale configuration entirely. The locale
switcher does not appear in their editor, and they are stored under the
internal
__mdcms_default__ locale.Locale switcher
When editing a localized document, a locale dropdown appears in the document editor. The switcher shows:- Existing variants — Locales that already have a translation for this document, displayed as links that navigate directly to that variant
- Untranslated locales — Supported locales that don’t have a variant yet, with a Create option to start a new translation
GET /api/v1/content/:documentId/variants, which returns all locale variants within the same translation group.
Creating translations
New translations are created via the document create endpoint with the target
locale parameter and an optional sourceDocumentId to copy content from an existing variant.
Independence of variants
Each locale variant is a fully independent document:- Own path — Each variant has its own filesystem path (e.g.,
content/blog/en/my-post.mdx,content/blog/fr/my-post.mdx) - Own body — The MDX content is independently editable
- Own frontmatter — Field values are independent across locales
- Own version history — Publishing, version snapshots, and draft revisions are tracked separately per variant
- Own status — One locale can be published while another remains in draft
Translation status in content lists
The content list for localized types includes a Translations column that shows coverage status per document. For example:- 2/4 locales — Two of four supported locales have variants
- 4/4 locales — All locales have variants