---
url: /en/docs/i18n.md
description: >-
  Manage multilingual content in Sveltia CMS with flexible i18n structures,
  configuration options, and best practices for international sites.
---

# Internationalization (i18n)

Sveltia CMS comes with first-class support for internationalization, allowing editors to manage content in multiple languages seamlessly. This guide covers the configuration options and best practices for setting up i18n in your Sveltia CMS projects.

::: tip Note for Netlify/Decap CMS users

All i18n issues in Netlify/Decap CMS have been resolved in Sveltia CMS. The [limitations](https://decapcms.org/docs/i18n/#limitations) mentioned in their documentation do not apply to Sveltia CMS.

:::

::: info Why i18n is at the core of Sveltia CMS

Sveltia CMS was originally built for [@kyoshino](https://github.com/kyoshino)’s Japanese clients, who needed a CMS that could handle multilingual content efficiently. The maintainer is a former long-time localizer for [Mozilla](https://www.mozilla.org/) and lives in the [most diverse city in the world](https://en.wikipedia.org/wiki/Toronto) where 150+ languages are spoken.

As a result, i18n support is deeply integrated into Sveltia CMS from the ground up, making it a powerful choice for projects that require multilingual content management.

:::

## Examples

See our [Showcase](/en/showcase?feature=i18n) for examples of websites using Sveltia CMS with i18n support. Most of them come with a link to the source code, which can be a great resource for learning how to implement i18n in your own projects.

## Configuration

To use i18n support in your Sveltia CMS project, you need to define the `i18n` option in the top-level, collection-level, and field-level configurations. For a [file collection](/en/docs/collections/files), file-level configuration is also required. See [Configuration Options](/en/docs/i18n/options) for what each level accepts.

The below example demonstrates how to set up i18n at all levels for an [entry collection](/en/docs/collections/entries):

::: code-group

```yaml{1-3,9,14,18,22} [YAML]
i18n:
  structure: multiple_folders
  locales: [en, de, fr]

collections:
  - name: posts
    label: Blog Posts
    folder: /content/posts
    i18n: true
    fields:
      - name: title
        label: Title
        widget: string
        i18n: true
      - name: date
        label: Date
        widget: datetime
        i18n: duplicate
      - name: body
        label: Body
        widget: richtext
        i18n: true
```

```toml{1-3,9,15,21,27} [TOML]
[i18n]
structure = "multiple_folders"
locales = ["en", "de", "fr"]

[[collections]]
name = "posts"
label = "Blog Posts"
folder = "/content/posts"
i18n = true

[[collections.fields]]
name = "title"
label = "Title"
widget = "string"
i18n = true

[[collections.fields]]
name = "date"
label = "Date"
widget = "datetime"
i18n = "duplicate"

[[collections.fields]]
name = "body"
label = "Body"
widget = "richtext"
i18n = true
```

```json{2-5,11,17,23,29} [JSON]
{
  "i18n": {
    "structure": "multiple_folders",
    "locales": ["en", "de", "fr"]
  },
  "collections": [
    {
      "name": "posts",
      "label": "Blog Posts",
      "folder": "/content/posts",
      "i18n": true,
      "fields": [
        {
          "name": "title",
          "label": "Title",
          "widget": "string",
          "i18n": true
        },
        {
          "name": "date",
          "label": "Date",
          "widget": "datetime",
          "i18n": "duplicate"
        },
        {
          "name": "body",
          "label": "Body",
          "widget": "richtext",
          "i18n": true
        }
      ]
    }
  ]
}
```

```js{2-5,11,17,23,29} [JavaScript]
{
  i18n: {
    structure: "multiple_folders",
    locales: ["en", "de", "fr"],
  },
  collections: [
    {
      name: "posts",
      label: "Blog Posts",
      folder: "/content/posts",
      i18n: true,
      fields: [
        {
          name: "title",
          label: "Title",
          widget: "string",
          i18n: true,
        },
        {
          name: "date",
          label: "Date",
          widget: "datetime",
          i18n: "duplicate",
        },
        {
          name: "body",
          label: "Body",
          widget: "richtext",
          i18n: true,
        },
      ],
    },
  ],
}
```

:::

Each level only takes effect on top of the one above it, so leaving one out would leave the content monolingual, with nothing to edit in the other locales. To catch this mistake early, Sveltia CMS reports the following as [configuration errors](/en/docs/config-basics#runtime-validation) on the login screen:

* The top-level `i18n` option is defined, but none of the collections or singletons have the `i18n` option.
* An entry collection has the `i18n` option, but none of its fields have `i18n: true` (or `translate`) or `i18n: duplicate`.
* A file collection has the `i18n` option, but none of its files have the `i18n` option.
* A collection file or singleton has the `i18n` option, but none of its fields have `i18n: true` (or `translate`) or `i18n: duplicate`.

A localized field nested in a List or Object field, or in a variable type, counts as well, and so do the fields of an entry collection’s [index file](/en/docs/collections/entries/listings#managing-hugo-s-special-index-file). Collections that don’t need translations can simply leave out the `i18n` option, so you can enable i18n for some collections only.

## Configuration Guides

The i18n options and behaviors are documented in detail on the following pages:

* [Configuration Options](/en/docs/i18n/options): The `i18n` option at the top, collection, file and field levels, and which locales are enabled by default when creating an entry.
* [Content Structures](/en/docs/i18n/structures): How localized content is stored on disk for entry and file collections, including nested collections and page bundles.
* [Localized Slugs and Preview Paths](/en/docs/i18n/slugs): Localize entry slugs, make them editable, use UUIDs for non-Latin content, and include the locale in preview URLs.

## Other I18n Features

Sveltia CMS embeds i18n support everywhere in the configuration and UI. Here are some additional features that enhance the multilingual content management experience.

* The [`summary` entry collection option](/en/docs/collections/entries/listings#summaries) supports the `{{locales}}` template tag to show enabled entry locales in the entry list.
* The [`default` Hidden field option](/en/docs/fields/hidden#default) supports the `{{locale}}` template tag to embed the locale code in an entry.
* The [`value_field` Relation field option](/en/docs/fields/relation#value-field) supports locale prefixes like `{{locale}}/{{slug}}`, which will be replaced with the current locale for i18n support in Astro. ([Discussion](https://github.com/sveltia/sveltia-cms/discussions/302))
* The Content Editor can be [linked to a specific locale](/en/docs/ui/content-editor#editor-pane-locale) using a URL query parameter.

## Translating Content

Sveltia CMS provides a built-in mechanism for managing content translations. When a user creates or edits an entry in one locale, they can easily switch to another locale and provide the translated content. The CMS automatically links the translations together based on the i18n configuration.

Adding or updating translations can be done directly in the Content Editor. When viewing an entry, users can use the locale switcher in the top-right corner to switch between locales. If a translation for the selected locale does not exist, an option to create a new translation is shown.

When creating a new translation, Sveltia CMS will pre-fill the fields with the content from the default locale, allowing the user to modify only the necessary parts for the translation. This streamlines the translation process and ensures consistency across different language versions of your content.

### Content Editor Features

See the [Content Editor I18n Support](/en/docs/ui/content-editor#i18n-support) guide for details on how Sveltia CMS enhances the Content Editor experience for multilingual content management, including locale switching, validation, and previewing.

### AI-Powered Translations

Sveltia CMS supports AI-powered translation integrations that can automatically translate content between supported languages. This feature can significantly speed up the localization process, especially for large amounts of content. Users can enable AI translations in the CMS settings and choose their preferred translation service. See the [Translation Services](/en/docs/integrations/translations) guide for more details.
