Skip to content
Closed
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
151 changes: 151 additions & 0 deletions localization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,151 @@
---
title: 'Localization'
description: 'Support multiple languages in your documentation'
icon: 'language'
---

Mintlify supports localization through its versioning system, allowing you to create documentation in multiple languages.

## Setting Up Localization

Add localization support by configuring the `versions` field in your `mint.json` file with locale specifications.

```json
"versions": [
{
"name": "English",
"locale": "en"
},
{
"name": "Español",
"locale": "es"
}
]
```

The first localization in the array serves as the default language.

## Supported Languages

Mintlify currently supports the following languages:

- English (`en`)
- Chinese (`cn`)
- Spanish (`es`)
- French (`fr`)
- Japanese (`jp`)
- Portuguese (`pt`)
- German (`de`)

<Note>
The locale codes must match exactly as shown above to enable automatic
translation of UI elements.
</Note>

## Organization

There are several ways to organize your localized content:

### Option 1: Folder Structure

Create separate folders for each language:

```
content/
├── en/
│ ├── quickstart.mdx
│ └── api-reference.mdx
├── es/
│ ├── quickstart.mdx
│ └── api-reference.mdx
└── fr/
├── quickstart.mdx
└── api-reference.mdx
```

### Option 2: Version Property

Specify the locale in your navigation groups or individual pages:

```json
"navigation": [
{
"group": "Getting Started",
"version": "en",
"pages": ["quickstart", "installation"]
},
{
"group": "Comenzar",
"version": "es",
"pages": ["es/quickstart", "es/installation"]
}
]
```

Or in the page metadata:

```yaml
---
title: "Quickstart"
version: "es"
---
```

## What Gets Translated

Localization in Mintlify works in two parts:

1. **UI Elements** - Fixed content like "Was this page helpful?" and navigation elements are automatically translated based on the selected locale.

2. **Documentation Content** - You are responsible for translating your actual documentation content, including:
- Page content
- Navigation labels
- Page titles and descriptions
- Component content

<Warning>
Mintlify does not automatically translate your documentation content. You must
provide translations for all content you want to be available in different
languages.
</Warning>

## Best Practices

<AccordionGroup>
<Accordion title="Consistent Structure">
Maintain the same structure across all languages. Each translated version should mirror the organization of your primary language.
</Accordion>

<Accordion title="Default Language">
Always specify a default language by putting it first in the versions array, or by explicitly setting `default: true`:

```json
"versions": [
{
"name": "English",
"locale": "en",
"default": true
}
]
```
</Accordion>

<Accordion title="Version Control">
Consider using branches or folders in your repository to manage different language versions effectively.
</Accordion>
</AccordionGroup>

## Shared Content

Content without a specified version or locale appears in all language versions. This is useful for:

- Images and other assets
- Code examples
- API references
- Universal components

## Related

<Card title="Versioning" icon="code-branch" href="/settings/versioning">
Learn about version control for your documentation
</Card>
Loading
Loading