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: fern/products/docs/pages/localization/overview.mdx
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,7 +33,7 @@ The manual setup below works today. Once localization is generally available, mo
33
33
34
34
<Steptitle="Add a translations folder">
35
35
36
-
Create a `translations` folder inside your `fern` directory, with a subfolder for each language using its [ISO 639-1 code](https://en.wikipedia.org/wiki/List_of_ISO_639-1_codes) (e.g., `fr`, `ja`). Mirror your `pages/` structure inside each language folder.
36
+
Create a `translations` folder inside your `fern` directory, with a subfolder for each language using its [BCP 47 language tag](https://en.wikipedia.org/wiki/IETF_language_tag) (e.g., `fr-FR`, `ja-JP`). Mirror your `pages/` structure inside each language folder.
37
37
38
38
<Files>
39
39
<Foldername="fern"defaultOpen>
@@ -44,13 +44,13 @@ Create a `translations` folder inside your `fern` directory, with a subfolder fo
44
44
<Filename="getting-started.mdx" />
45
45
</Folder>
46
46
<Foldername="translations"defaultOpenhighlighted>
47
-
<Foldername="fr"defaultOpen>
47
+
<Foldername="fr-FR"defaultOpen>
48
48
<Foldername="pages"defaultOpen>
49
49
<Filename="introduction.mdx" />
50
50
<Filename="getting-started.mdx" />
51
51
</Folder>
52
52
</Folder>
53
-
<Foldername="ja"defaultOpen>
53
+
<Foldername="ja-JP"defaultOpen>
54
54
<Foldername="pages"defaultOpen>
55
55
<Filename="introduction.mdx" />
56
56
<Filename="getting-started.mdx" />
@@ -71,9 +71,9 @@ instances:
71
71
- url: your-org.docs.buildwithfern.com
72
72
73
73
translations:
74
-
- lang: en
75
-
- lang: fr
76
-
- lang: ja
74
+
- lang: en-US
75
+
- lang: fr-FR
76
+
- lang: ja-JP
77
77
```
78
78
79
79
</Step>
@@ -82,14 +82,18 @@ translations:
82
82
83
83
Each translated `.mdx` mirrors its source page's content. Use the `sidebar-title` frontmatter field to override the sidebar entry per language:
84
84
85
-
```mdx translations/fr/pages/introduction.mdx
85
+
```mdx translations/fr-FR/pages/introduction.mdx
86
86
---
87
87
sidebar-title: Introduction
88
88
---
89
89
90
90
Bienvenue dans la documentation.
91
91
```
92
92
93
+
<Tip>
94
+
You only need to translate the files you want to localize. Anything missing from a language folder — pages, images, or other assets — falls back to the default-language version.
0 commit comments