Skip to content

Commit 85d5377

Browse files
fern-api[bot]devin-ai-integration[bot]bot_apkdevalog
authored
Update localization docs: BCP-47 codes and fallback behavior (#5202)
Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: bot_apk <apk@cognition.ai> Co-authored-by: Devin Logan <devinannlogan@gmail.com>
1 parent 94aad5b commit 85d5377

3 files changed

Lines changed: 13 additions & 7 deletions

File tree

.vale/styles/FernStyles/Acronyms.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,3 +106,4 @@ exceptions:
106106
- WSS
107107
- GEO
108108
- SPDX
109+
- BCP

.vale/styles/FernStyles/Headings.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,4 @@ exceptions:
8888
- WSS
8989
- GEO
9090
- OG
91+
- BCP

fern/products/docs/pages/localization/overview.mdx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ The manual setup below works today. Once localization is generally available, mo
3333

3434
<Step title="Add a translations folder">
3535

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.
3737

3838
<Files>
3939
<Folder name="fern" defaultOpen>
@@ -44,13 +44,13 @@ Create a `translations` folder inside your `fern` directory, with a subfolder fo
4444
<File name="getting-started.mdx" />
4545
</Folder>
4646
<Folder name="translations" defaultOpen highlighted>
47-
<Folder name="fr" defaultOpen>
47+
<Folder name="fr-FR" defaultOpen>
4848
<Folder name="pages" defaultOpen>
4949
<File name="introduction.mdx" />
5050
<File name="getting-started.mdx" />
5151
</Folder>
5252
</Folder>
53-
<Folder name="ja" defaultOpen>
53+
<Folder name="ja-JP" defaultOpen>
5454
<Folder name="pages" defaultOpen>
5555
<File name="introduction.mdx" />
5656
<File name="getting-started.mdx" />
@@ -71,9 +71,9 @@ instances:
7171
- url: your-org.docs.buildwithfern.com
7272

7373
translations:
74-
- lang: en
75-
- lang: fr
76-
- lang: ja
74+
- lang: en-US
75+
- lang: fr-FR
76+
- lang: ja-JP
7777
```
7878
7979
</Step>
@@ -82,14 +82,18 @@ translations:
8282
8383
Each translated `.mdx` mirrors its source page's content. Use the `sidebar-title` frontmatter field to override the sidebar entry per language:
8484

85-
```mdx translations/fr/pages/introduction.mdx
85+
```mdx translations/fr-FR/pages/introduction.mdx
8686
---
8787
sidebar-title: Introduction
8888
---
8989
9090
Bienvenue dans la documentation.
9191
```
9292

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.
95+
</Tip>
96+
9397
</Step>
9498

9599
<Step title="Generate your docs">

0 commit comments

Comments
 (0)