Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added localization setup details to versioning page #440

Merged
merged 5 commits into from
Jan 3, 2025
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
2 changes: 1 addition & 1 deletion settings/global.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ Japanese, and Portuguese.
</Info>

For more information, please refer to our
[versioning documentation](/settings/versioning).
[versioning & localization documentation](/settings/versioning).

Example:

Expand Down
54 changes: 46 additions & 8 deletions settings/versioning.mdx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
---
title: 'Versioning'
description: 'Build separate versions'
title: 'Versioning & Localization'
description: 'Build separate versions or localizations'
icon: 'square-chevron-down'
---

Mintlify supports versioning or localization. You can use one or the other, not both.

These guides will assume `v1` pages are in a folder named `v1`, `v2` pages are in a folder named `v2`, and so on. While this method of structuring your files isn't strictly necessary, it's a great way to keep your files organized.

## Setup
## Versioning

### Setup

Add `"versions": ["v2", "v1"]` to your `mint.json` file where `v1` and `v2` are the names of your versions. You can put any number of versions in this array. The first version from the array serves as the default version.

Expand All @@ -26,7 +30,7 @@ If you would like to specify a default version, you can do so like this:
`mint.json`.
</Tip>

## Versioning Groups and Pages
### Versioning Groups and Pages

The best way to specify page versions is by adding a version value to a group in the navigation. When you specify the version of a group, that version is applied to all pages within that group.

Expand Down Expand Up @@ -55,7 +59,7 @@ version: 'v2'
While it is possible to nest versioned groups within versioned groups, it is not recommended. If you do take this approach, the more deeply-nested version takes precedence.
</Warning>

### Versioning Tabs and Anchors
#### Versioning Tabs and Anchors

You can hide a tab or anchor based on a version. This is useful if you have links that are only relevant in one version. Importantly, this does **not** apply the version to the pages within that anchor.

Expand Down Expand Up @@ -102,15 +106,15 @@ In `mint.json`, simply add `version` to your tab or anchor. Tabs and anchors wit
```
</CodeGroup>

### Sharing Between Versions
#### Sharing Between Versions

Not _all_ content has to be hidden though! Any content without a specified version appears in every version so you don't have to duplicate content!

<Tip>
When using localization with versioning, each version can have its own set of translations. This means you can have different language versions for different API versions, giving you full flexibility in managing both versioned and localized content.
</Tip>

## Troubleshooting
### Troubleshooting

Common errors and how to fix them

Expand All @@ -126,4 +130,38 @@ Common errors and how to fix them
navigation, make sure you spelled the version the same as in your `versions`
array in `mint.json`.
</Accordion>
</AccordionGroup>
</AccordionGroup>

## Localization

### Setup

baell marked this conversation as resolved.
Show resolved Hide resolved
Using `"versions"` in your `mint.json` file where `en`, `fr`, and `es` are the names of your localizations. The first localization from the array serves as the default localization.

baell marked this conversation as resolved.
Show resolved Hide resolved
We currently support localization in English, Chinese, Spanish, French, Japanese, and Portuguese.

Set your localization in your `mint.json` file like this:

```json
"versions": [
{
"name": "English",
"locale": "en",
},
{
"name": "French",
"locale": "fr",
},
{
"name": "Spanish",
"locale": "es"
}
]
```

<Tip>
hahnbeelee marked this conversation as resolved.
Show resolved Hide resolved
The versions dropdown will show your localizations in the order you include them in
`mint.json`.
</Tip>

Once setup, the rest of localization is handled by the versioning setup described above.
Loading