Localization
Fern lets you publish your documentation in multiple languages from a single set of source files. Readers switch languages from a dropdown in the header, search is scoped to the active language, and each locale has its own URL so search engines can index it separately.
You supply the translations and Fern handles the rest: rendering a language switcher in the header, scoping each locale to its own URL path, and falling back to the default language for any page you haven’t translated yet.
See it live on the i18n example site (source).
Localization is under active development. Ask Fern, fern check errors, and API Reference pages are still in progress.
Reach out if you’re interested in implementing localization for your docs.
Early access setup
The manual setup below works today. Once localization is generally available, most of these steps will be handled for you.
Declare languages in docs.yml
Add a translations key to your docs.yml listing each supported language. Mark one language as the default.
Fern supports both two-letter ISO 639-1 codes (e.g., en, ja, zh) and full BCP 47 locale tags (e.g., ja-JP, pt-BR, zh-Hans-CN).
Add a translations folder
Create a translations folder inside your fern directory. Each language declared in docs.yml needs a subfolder matching its locale code. This folder contains your translated content and navigation overrides.
Translate page content
Place translated .mdx files in fern/translations/{locale}/products/ mirroring the original file structure. Use the sidebar-title frontmatter field to override the sidebar entry per language:
You only need to translate the files you want to localize. Any page that’s registered in the localized navigation but has no matching .mdx falls back to the default-language file automatically.
Adding a translated .mdx alone isn’t enough to localize a page — the page must also have an entry in the localized navigation YAML. Without a localized nav entry, the page falls back to the default language even when a translation file exists.