Skip to content

Commit 048eaaa

Browse files
baellBrandon Waselnukhahnbeelee
authored
added localization setup details to versioning page (#440)
* added localization setup details to versioning page * Update settings/versioning.mdx Co-authored-by: Hahnbee Lee <[email protected]> * Update settings/versioning.mdx Co-authored-by: Hahnbee Lee <[email protected]> * update copy * add the --------- Co-authored-by: Brandon Waselnuk <[email protected]> Co-authored-by: Hahnbee Lee <[email protected]>
1 parent f890bab commit 048eaaa

File tree

2 files changed

+60
-16
lines changed

2 files changed

+60
-16
lines changed

settings/global.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,12 +308,12 @@ locale. We currently support localization in English, Chinese, Spanish, French,
308308
Japanese, and Portuguese.
309309

310310
<Info>
311-
Localization applies to the UI and fixed assets in the docs, such as "was this
312-
page helpful".
311+
Localization auto-translates the UI and fixed assets in the docs, such as "Was
312+
this page helpful?". You must translate the content of the pages yourself.
313313
</Info>
314314

315315
For more information, please refer to our
316-
[versioning documentation](/settings/versioning).
316+
[versioning & localization documentation](/settings/versioning).
317317

318318
Example:
319319

settings/versioning.mdx

Lines changed: 57 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
---
2-
title: 'Versioning'
3-
description: 'Build separate versions'
4-
icon: 'square-chevron-down'
2+
title: "Versioning & Localization"
3+
description: "Build separate versions or localizations"
4+
icon: "square-chevron-down"
55
---
66

7+
Mintlify supports versioning or localization. You can use one or the other, not both.
8+
79
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.
810

9-
## Setup
11+
## Versioning
12+
13+
### Setup
1014

1115
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.
1216

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

29-
## Versioning Groups and Pages
33+
### Versioning Groups and Pages
3034

3135
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.
3236

@@ -45,17 +49,20 @@ You can also specify the version of a single page in the page metadata. Versions
4549

4650
```yaml Pages (quickstart.mdx)
4751
---
48-
title: 'Quickstart'
49-
version: 'v2'
52+
title: "Quickstart"
53+
version: "v2"
5054
---
5155
```
56+
5257
</CodeGroup>
5358

5459
<Warning>
55-
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.
60+
While it is possible to nest versioned groups within versioned groups, it is
61+
not recommended. If you do take this approach, the more deeply-nested version
62+
takes precedence.
5663
</Warning>
5764

58-
### Versioning Tabs and Anchors
65+
#### Versioning Tabs and Anchors
5966

6067
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.
6168

@@ -100,17 +107,21 @@ In `mint.json`, simply add `version` to your tab or anchor. Tabs and anchors wit
100107
},
101108
],
102109
```
110+
103111
</CodeGroup>
104112

105-
### Sharing Between Versions
113+
#### Sharing Between Versions
106114

107115
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!
108116

109117
<Tip>
110-
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.
118+
When using localization with versioning, each version can have its own set of
119+
translations. This means you can have different language versions for
120+
different API versions, giving you full flexibility in managing both versioned
121+
and localized content.
111122
</Tip>
112123

113-
## Troubleshooting
124+
### Troubleshooting
114125

115126
Common errors and how to fix them
116127

@@ -119,11 +130,44 @@ Common errors and how to fix them
119130
You likely nested a version inside of another. For example, your group had version "v1" but your page had version "v2".
120131

121132
We do not recommend nesting versions inside of each other because it's hard to maintain your docs later.
133+
122134
</Accordion>
123135

124136
<Accordion title="Missing Pages" icon="circle-exclamation">
125137
If you add versions to your docs and the pages disappeared from your
126138
navigation, make sure you spelled the version the same as in your `versions`
127139
array in `mint.json`.
128140
</Accordion>
129-
</AccordionGroup>
141+
</AccordionGroup>
142+
143+
## Localization
144+
145+
### Setup
146+
147+
`"versions"` in your `mint.json` can be leveraged to create different language versions by adding a `locale` value to the version. The first localization from the array serves as the default localization.
148+
149+
We currently support localization in English (`en`), Chinese (`cn`), Spanish (`es`), French (`fr`), Japanese (`jp`), Portuguese (`pt`), and German (`de`).
150+
151+
```json mint.json example
152+
"versions": [
153+
{
154+
"name": "English",
155+
"locale": "en",
156+
},
157+
{
158+
"name": "French",
159+
"locale": "fr",
160+
},
161+
{
162+
"name": "Spanish",
163+
"locale": "es"
164+
}
165+
]
166+
```
167+
168+
<Tip>
169+
The versions dropdown will show your localizations in the order you include
170+
them in the `mint.json`.
171+
</Tip>
172+
173+
Once setup, the rest of localization is handled by the versioning setup described above.

0 commit comments

Comments
 (0)