You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: settings/versioning.mdx
+46-8Lines changed: 46 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,12 +1,16 @@
1
1
---
2
-
title: 'Versioning'
3
-
description: 'Build separate versions'
2
+
title: 'Versioning & Localization'
3
+
description: 'Build separate versions or localizations'
4
4
icon: 'square-chevron-down'
5
5
---
6
6
7
+
Mintlify supports versioning or localization. You can use one or the other, not both.
8
+
7
9
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.
8
10
9
-
## Setup
11
+
## Versioning
12
+
13
+
### Setup
10
14
11
15
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.
12
16
@@ -26,7 +30,7 @@ If you would like to specify a default version, you can do so like this:
26
30
`mint.json`.
27
31
</Tip>
28
32
29
-
## Versioning Groups and Pages
33
+
###Versioning Groups and Pages
30
34
31
35
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.
32
36
@@ -55,7 +59,7 @@ version: 'v2'
55
59
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.
56
60
</Warning>
57
61
58
-
### Versioning Tabs and Anchors
62
+
####Versioning Tabs and Anchors
59
63
60
64
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.
61
65
@@ -102,15 +106,15 @@ In `mint.json`, simply add `version` to your tab or anchor. Tabs and anchors wit
102
106
```
103
107
</CodeGroup>
104
108
105
-
### Sharing Between Versions
109
+
####Sharing Between Versions
106
110
107
111
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!
108
112
109
113
<Tip>
110
114
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.
111
115
</Tip>
112
116
113
-
## Troubleshooting
117
+
###Troubleshooting
114
118
115
119
Common errors and how to fix them
116
120
@@ -126,4 +130,38 @@ Common errors and how to fix them
126
130
navigation, make sure you spelled the version the same as in your `versions`
127
131
array in `mint.json`.
128
132
</Accordion>
129
-
</AccordionGroup>
133
+
</AccordionGroup>
134
+
135
+
## Localization
136
+
137
+
### Setup
138
+
139
+
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.
140
+
141
+
We currently support localization in English, Chinese, Spanish, French, Japanese, and Portuguese.
142
+
143
+
Set your localization in your `mint.json` file like this:
144
+
145
+
```json
146
+
"versions": [
147
+
{
148
+
"name": "English",
149
+
"locale": "en",
150
+
},
151
+
{
152
+
"name": "French",
153
+
"locale": "fr",
154
+
},
155
+
{
156
+
"name": "Spanish",
157
+
"locale": "es"
158
+
}
159
+
]
160
+
```
161
+
162
+
<Tip>
163
+
The versions dropdown will show your localizations in the order you include them in
164
+
`mint.json`.
165
+
</Tip>
166
+
167
+
Once setup, the rest of localization is handled by the versioning setup described above.
0 commit comments