File structure
Organize translated content in language-specific directories to keep your documentation maintainable and structure your navigation by language. Create a separate directory for each language using ISO 639-1 language codes. Place translated files in these directories with the same structure as your default language.Example file structure
Configure the language switcher
To add a language switcher to your documentation, configure thelanguages array in your docs.json navigation.
docs.json
languages array requires:
language: ISO 639-1 language code- Full navigation structure
- Paths to translated files
Global navigation
To add global navigation elements that appear across all languages, configure theglobal object in your docs.json navigation.
docs.json
External URLs for language switcher
For multi-domain documentation setups where different locales are hosted on separate domains, you can configure external URLs in the language switcher. This is useful when not all pages exist in all locales or when you maintain separate documentation sites per region. Configure default external URLs in yourdocs.json:
docs.json
Per-page locale links
Override the default language switcher URLs for specific pages using frontmatter. This allows you to link directly to the translated version of the current page instead of the homepage. Add locale-specific links to your page frontmatter using the pattern{language_code}_link:
api-reference/introduction.mdx
href configured in docs.json. This is particularly useful for:
- Multi-domain documentation where each locale has its own domain
- Documentation sites where not all pages are translated
- Linking to equivalent pages across different documentation systems
Maintain translations
Keep translations accurate and synchronized with your source content.Translation workflow
- Update source content in your primary language.
- Identify changed content.
- Translate changed content.
- Review translations for accuracy.
- Update translated files.
- Verify navigation and links work.
Automated translations
For automated translation solutions, contact the Mintlify sales team.Images and media
Store translated images in language-specific directories.es/index.mdx
SEO for multi-language sites
Optimize each language version for search engines.Page metadata
Include translated metadata in each file’s frontmatter:fr/index.mdx
hreflang tags
Mintlify automatically generates hreflang tags for each language version of your documentation to help search engines understand the relationships between translated pages.Best practices
Date and number formats
Consider locale-specific formatting for dates and numbers.- Date formats: MM/DD/YYYY vs DD/MM/YYYY
- Number formats: 1,000.00 vs 1.000,00
- Currency symbols: $100.00 vs 100,00€
Maintain consistency
- Maintain content parity across all languages to ensure every user gets the same quality of information.
- Create a translation glossary for technical terms.
- Keep the same content structure across languages.
- Match the tone and style of your source content.
- Use Git branches to manage translation work separately from main content updates.
Layout differences
Some languages require more or less space than English. Test your translated content on different screen sizes to ensure:- Navigation fits properly.
- Code blocks don’t overflow.
- Tables and other formatted text remain readable.
- Images scale appropriately.